本文整理汇总了Python中pts.core.basics.configuration.ConfigurationDefinition.import_section方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigurationDefinition.import_section方法的具体用法?Python ConfigurationDefinition.import_section怎么用?Python ConfigurationDefinition.import_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts.core.basics.configuration.ConfigurationDefinition
的用法示例。
在下文中一共展示了ConfigurationDefinition.import_section方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
definition.add_flag("transient_heating", "enable transient heating", False)
definition.add_flag("selfabsorption", "enable dust selfabsorption", False)
# For remote execution
definition.add_optional("host_ids", "string_list", "remote hosts to use for heavy computations and simulations", choices=find_host_ids())
definition.add_flag("attached", "launch remote executions in attached mode", False)
# Fitting
definition.add_optional("ngenerations", "positive_integer", "number of generations", 5)
definition.add_optional("nsimulations", "even_positive_integer", "number of simulations per generation", 30)
definition.add_optional("npackages_fitting", "positive_integer", "number of photon packages for each fitting simulation", int(1e4))
# Free parameters
definition.add_optional("free_parameters", "string_list", "free parameter labels", choices=possible_free_parameters, default=default_free_parameters)
definition.add_optional("relative_range_initial", "real_range", "relative range for generating the initial parameter values", default="0.3>3", convert_default=True)
definition.add_optional("relative_range_fitting", "real_range", "relative range of the free parameter values for the fitting", default="0.1>20", convert_default=True)
# Wavelength grid
definition.add_optional("wavelength_range", "quantity_range", "range of wavelengths", "0.1 micron > 2000 micron", convert_default=True)
# Dust grid
definition.add_optional("physical_domain_disk_ellipse_factor", "positive_real", "factor of the disk ellipse region to take as the physical domain of the model", 0.82)
# Genetic section
definition.import_section("genetic", "genetic algorithm options", genetic_definition)
# Flags
definition.add_flag("spectral_convolution", "use spectral convolution to calculate observed fluxes", False)
# -----------------------------------------------------------------
示例2: ConfigurationDefinition
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
normalizations = ["max", "sum"]
# -----------------------------------------------------------------
# Create configuration definition
definition = ConfigurationDefinition()
# Distributions
definition.add_positional_optional("distributions", "filepath_list", "distribution files to be plotted")
definition.add_flag("panels", "plot the distributions in separate panels")
definition.add_flag("recursive", "search distribution files recursively in the working directory")
definition.add_optional("normalize", "string", "normalize all distributions by a certain method", choices=normalizations)
definition.add_optional("normalization_value", "real", "value for normalization", 1.)
# Add plotting options
definition.import_section("plot", "plotting options", plot_definition)
definition.sections["plot"].optional["xsize"].default = 8
definition.sections["plot"].optional["ysize"].default = 4
definition.add_flag("logscale", "use value log scale")
definition.add_flag("logfrequency", "use log scale for frequency")
definition.add_optional("bar_width", "positive_real", "relative width of the bars (1 means edges touch)", 1.)
definition.add_flag("use_name_xlabel", "use the distribution name(s) for the x labels of the panels")
definition.add_flag("colours_per_panel", "reuse the same colours for each panel")
# Add features
definition.add_flag("smooth", "add smooth curves to plot")
definition.add_flag("statistics", "add statistics to plot")
definition.add_flag("extrema", "add extrema to plot")
definition.add_flag("minima", "add minima", None)
definition.add_flag("maxima", "add maxima", None)
definition.add_flag("hatches", "add hatches", False)
示例3:
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
# Crashed
definition.add_flag("check_crashed", "check whether crashed simulations have the necessary output, if so, retrieve them")
definition.add_optional("retrieve_crashed", "string_integer_list_dictionary", "retrieve crashed simulations for these hosts and simulation IDs")
definition.add_flag("check_data", "for crashed simulations, check whether the simulation data is valid")
# -----------------------------------------------------------------
definition.add_flag("ignore_missing_data", "ignore missing data when analysing the simulations", False)
definition.add_flag("batch_replace", "replace timing and memory information when a simulation is ")
# -----------------------------------------------------------------
definition.add_flag("offline", "run in offline mode: only analyse already retrieved simulations and tasks, don't try to connect to remotes")
# -----------------------------------------------------------------
# ADVANCED
definition.add_optional("nopen_files", "positive_integer", "number of allowed open files", 2000)
# -----------------------------------------------------------------
# Add section for analysis options
definition.import_section("analysis", "analyser options", analysis_definition)
# -----------------------------------------------------------------
definition.add_flag("simulations", "get status of simulations", True)
definition.add_flag("tasks", "get status of tasks", True)
# -----------------------------------------------------------------
示例4: ConfigurationDefinition
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
# Create the configuration definition
definition = ConfigurationDefinition()
# Add required
definition.add_positional_optional("remote", "string", "ID of the remote host", choices=find_host_ids())
definition.add_positional_optional("id", "integer", "ID of the simulation")
# Add flags
definition.add_flag("ignore_missing_data", "ignore missing data when analysing the simulations", False)
# Analyse
definition.add_flag("do_basic", "do basic analysis", True)
definition.add_flag("do_batch", "do batch analysis", True)
definition.add_flag("do_scaling", "do scaling analysis", True)
definition.add_flag("do_extra", "do extra analysis", True)
# -----------------------------------------------------------------
# Import settings for basic, batch analysis
definition.import_section("basic", "basic analysis options", basic_definition)
definition.import_section("batch", "batch analysis options", batch_definition)
# Remove certain settings from the sections
definition.sections["basic"].remove_positional_optional("remote")
definition.sections["basic"].remove_positional_optional("id")
definition.sections["batch"].remove_positional_optional("remote")
definition.sections["batch"].remove_positional_optional("id")
# -----------------------------------------------------------------
示例5: ConfigurationDefinition
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition
from pts.evolve.solve.extremizer import genetic_definition
# -----------------------------------------------------------------
# Create the configuration
definition = ConfigurationDefinition()
# Genetic settings
definition.import_section("genetic", "genetic algorithm settings", genetic_definition)
# Add
definition.sections["genetic"].add_optional("ngenerations", "positive_integer", "number of generations", 10)
definition.sections["genetic"].add_optional("nindividuals", "even_integer", "number of individuals per generation", 100)
# -----------------------------------------------------------------
示例6: ConfigurationDefinition
# 需要导入模块: from pts.core.basics.configuration import ConfigurationDefinition [as 别名]
# 或者: from pts.core.basics.configuration.ConfigurationDefinition import import_section [as 别名]
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# Import the relevant PTS classes and modules
from pts.core.basics.configuration import ConfigurationDefinition
from pts.magic.config.find_sources import definition as sources_definition
# -----------------------------------------------------------------
# Create definition
definition = ConfigurationDefinition(write_config=False)
# Galaxy
definition.add_optional("galaxy_name", "string", "name of the galaxy", "M51")
definition.add_optional("filter", "filter", "image filter", "R")
definition.add_optional("year", "positive_integer", "year of the image")
# Add section for the source finder
definition.import_section("sources", "options for the source finder", sources_definition)
# Flags
default_catalogs = ["2MASS"]
definition.add_optional("catalogs", "string_list", "catalogs for point sources", default_catalogs)
definition.add_flag("catalog_overlapping", "only fetch catalog data in the area where all images are overlapping", True)
# Manual (use SourceMarker)
definition.add_flag("manual", "don't find sources, but mark them from the catalog, and let the selection be done manually", False)
# -----------------------------------------------------------------