Skip to content

Create a config file to define physical constants and default settings used in the code #22

@morcuended

Description

@morcuended

There are several possibilities:

  • yaml
  • toml
  • json
  • ini

I slightly prefer toml (see an example of config file here https://github.com/cta-observatory/cta-lstchain/blob/master/docs/examples/post_dl2_analysis/config_wobble.toml) since it allows for comments and it has nice readability. It would require to install the toml package.

[foo]
bar = 1

How to use it:

import toml

config = toml.load(config_file_name)
bar_value = config['foo']['bar']

Side note: maybe for constant it would be more convenient to directly use scipy.constants https://docs.scipy.org/doc/scipy/reference/constants.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions