| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The "setn()" method is a corresponding operation with the "getn()",
which set the value of a config option to the given value.
This function will be used in the Web UI to interact with the WebSocket
communications.
Also add the "merge()" method which simply merge the input
configurations without any validation.
|
|
|
|
|
|
|
|
| |
* Remove the optional parameter "sep", therefore the key must be
"/"-separated or a list of keys.
* Add exception handling and raise "KeyError" if the input key is
invalid (i.e., specifies a non-exist option).
* Update comments and docstring.
|
|
|
|
|
|
|
|
| |
Originally, the user configuration file is only allowed to load once,
and prevent any future loading of user configuration file.
This change allows load user configuration file again by resetting the
current configurations to defaults before loading.
|
| |
|
|
|
|
|
|
|
|
| |
* Keep a copy of the default configurations from the specifications
* Add "dump()" method to dump the configurations (as well as the default
configurations) as plain Python dictionary
* Add new parameter "from_default" to methods "get()" and "getn()" to
allow get the config value from the default configurations
|
| |
|
|
|
|
|
|
|
| |
The "filter()" returns an iterator, that is consumed after the use,
therefore, the "specfiles" is used by the print under "DEBUG_FG21SIM".
Then "specfiles" is empty and thus prevents the reading of the
specification files.
|
| |
|
|
|
|
|
|
|
|
| |
Change the "__init__()" method to load the user configurations (i.e., by
invoke the "read_userconfig()" method) instead of loading extra general
configurations.
Method "getn()": also check the validity for the parameter "sep".
|
|
|
|
| |
No functional changes.
|
|
|
|
|
|
| |
* Return None if specified config is None or not exist
* Raise ValueError if specified config is non-string
* Update comments
|
|
|
|
|
|
|
|
|
| |
After this switch to `pkg_resources`, this package can also be installed
as an EGG (a zip archive), which is more generic.
References:
* http://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access
* http://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
|
|
|
|
|
|
| |
Since the logging is not avaiable at the moment, we can only use the
plain `print` for debugging, if the environment variable "DEBUG_FG21SIM"
is defined.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This "read_userconfig()" method is specifically used to load the user
configuration file, and record the absolute path of the configuration
file, which allows the use of relative path to specify the input files
(e.g., galactic/synchrotron/template) for simulation within the
configurations.
|
| |
|
|
|
|
|
| |
The "frequencies" property will return or calculate the frequency
values of the simulation.
|
| |
|
| |
|
| |
|
|
|
|
| |
Also unify the quote style.
|
|
|
|
| |
The NumPy docstring style is used.
|
|
|
|
| |
Also improve the comments.
|
| |
|
|
|
|
|
|
| |
Since we do not use string interpolation in configs, so disable this
feature, otherwise `MissingInterpolationOption` error happens due to the
"logging" configs which contains string formats.
|
|
|
|
|
|
|
| |
This "logging" property get and perpare the configurations
for `logging.basicConfig()` use.
Needs testing.
|
|
This is very basic at the moment, and needs many improvements.
Thanks: https://github.com/pazz/alot
TODO: Add config specifications with default values
|