neclib.core.configuration#
Aliases#
Error related to parameter configuration. |
|
Error related to limitation on parameter name. |
|
Parameters with flexible look-up and high-level representation support. |
|
Value range bound by 2 values. |
|
Get logger instance which prints operation logs to console. |
|
Read a file, if itβs accessible via any available way. |
- class Configuration(*args, **kwargs)[source]#
Bases:
RichParameters
- classmethod from_file(_Configuration__path)[source]#
Read parameters from a TOML file.
- Parameters:
file β The file path or file object.
_Configuration__path (Union[PathLike, str, IO]) β
Examples
>>> params = RichParameters.from_file("path/to/file.toml")
You can also read parameters from a file-like object.
>>> with open("path/to/file.toml") as f: ... params = RichParameters.from_file(f)
And if you wish, remote files can be read:
>>> params = RichParameters.from_file("https://example.com/file.toml")
- reload()[source]#
Reload the configuration.
This method is to reflect the changes made to the configuration file or the change of environment variables.
- classmethod configure()[source]#
Copy default configuration files into your local file system.
Important
The files would be placed in
$HOME/.necst/
. The file contents MUST BE UPDATED accordingly, before using this software to actually drive your telescope.Caution
Running this software with misconfigured parameter files could result in catastrophic damage to your telescope, by many possible cause. The consequence can include: 1) the antenna becomes uncontrollable because the commands are calculated in positive feedback, 2) damage your receivers with applying too large voltage, and so on.
- property parameters: Dict[str, Any]#
Return a copy of the raw parameters.
- find_config()[source]#
Look for the configuration file from environment variables and defaults.
- Return type:
str
- class ConfigurationView(prefix='', /, **kwargs)[source]#
Bases:
Configuration
Sliced configuration.
- Parameters:
prefix (str) β
- config = Configuration(159 elements)#
Collection of system-wide configurations.
- configure()#
Copy default configuration files into your local file system.
Important
The files would be placed in
$HOME/.necst/
. The file contents MUST BE UPDATED accordingly, before using this software to actually drive your telescope.Caution
Running this software with misconfigured parameter files could result in catastrophic damage to your telescope, by many possible cause. The consequence can include: 1) the antenna becomes uncontrollable because the commands are calculated in positive feedback, 2) damage your receivers with applying too large voltage, and so on.