Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration & data are not in expected (XDG) locations #124

Closed
khaeru opened this issue Feb 26, 2019 · 1 comment · Fixed by #130
Closed

Configuration & data are not in expected (XDG) locations #124

khaeru opened this issue Feb 26, 2019 · 1 comment · Fixed by #130
Assignees
Labels
enh New features & functionality
Milestone

Comments

@khaeru
Copy link
Member

khaeru commented Feb 26, 2019

Several related issues here that could be fixed together.

  1. ixmp-config places a file at ~/.local/ixmp/config.json. This does not conform to the XDG base directory specification. The file should be at either:
    • ~/.local/share/ixmp/config.json — i.e. using $XDG_DATA_HOME or its default.
    • ~/.config/ixmp.json or ~/.config/ixmp/config.json — i.e. using $XDG_CONFIG_HOME or its default.
  2. Likewise the localdb directory created with ixmp.Platform(dbtype='HSQLDB') is incorrectly at ~/.local/ixmp/localdb instead of ~/.local/share/ixmp/localdb.
  3. ixmp.config.get() raises an exception if the configuration file is missing. Sensible defaults should be used instead.
@khaeru
Copy link
Member Author

khaeru commented Mar 12, 2019

An example of item 3: on #128 @danielhuppmann wrote:

in the current setup, the local default HSQLDB is touched every time a user re-installs and runs the tests on the tutorial notebooks. So the default database files become quite bloated over time. Would it be possible to connect the tutorial-notebook tests to a temporary db?

This could be fixed by the following new functionality:
—check for an environment variable, IXMP_CONFIG.
—look in that directory for config.json, before any other path such as the current defaults.

Then the tests could pass a specific value of IXMP_CONFIG in order to not modify the user's configuration.

@khaeru khaeru self-assigned this Mar 13, 2019
@khaeru khaeru added the enh New features & functionality label Mar 13, 2019
@khaeru khaeru added this to the 0.2 milestone Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant