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

flexible configuration system #315

Closed
orbeckst opened this issue Jun 16, 2015 · 4 comments
Closed

flexible configuration system #315

orbeckst opened this issue Jun 16, 2015 · 4 comments

Comments

@orbeckst
Copy link
Member

At the moment, MDAnalysis does not use any files for configuration. There are currently three main areas where we use configuration values:

  1. The flag registry in MDAnalysis.core.flags determines global behavior. In principle, these flags can be changed by the user but in practice this seems to be rarely done. In any case, changes are not persistent and have to be changed for a new python session manually by setting the flag.
  2. Names for guessing atom elements and masses are stored in MDAnalysis.topology.tables.
  3. Residue names for special selections such as "protein" or "nucleic" are hard-coded in the specific selection methods in MDAnalysis.core.Selection. Issue Managing default selection keywords #104 wants to change this in particular.

At least 1 and 3 should be configurable through a common mechanism and possibly through an optional preferences file that a user might want to keep in her home directory. MDAnalysis could ship with the default config file that will then be used to load the defaults, making all configurable values very transparent.
The current flag registry is a bit of hack to accomplish a fraction of what ipython/jupyter's traitlets achieve nicely and cleanly with their traitlets.config. traitlets is on PyPi and can be easily added as a dependency. It allows JSON and Python files for configuration and does type checking.

I propose we look into adapting traitlets.config (or something similar) as a basis for a flexible configuration system for MDAnalysis. I'd suggest we start with first transitioning 1 and 3 over to a new configuration system and then add other classes such as the hydrogen bond analysis and the atom typing tables.

Comments, ideas?

@kain88-de
Copy link
Member

I had a short look into the configurable stuff. I would say to remove the configuration options, they are not used and all are much better suited to be stated explicit during Universe construction.

For the atom names and residue name an extension mechanism would be nice though.

@richardjgowers
Copy link
Member

Yeah I'm tempted to say remove flags too, it's kind of hidden currently, and I'm still not 100% sure what it does

@orbeckst
Copy link
Member Author

orbeckst commented Feb 7, 2016

The original idea was that you could customize the overall behavior but it was never really used and perhaps it's not even a good idea to have the option to eg change the base units or disable automatic unit conversion.

I have no problem if someone opens an issue to get rid of it.

Oliver Beckstein
email: [email protected]

Am Feb 6, 2016 um 11:23 schrieb Richard Gowers [email protected]:

Yeah I'm tempted to say remove flags too, it's kind of hidden currently, and I'm still not 100% sure what it does


Reply to this email directly or view it on GitHub.

@orbeckst
Copy link
Member Author

The consensus is to get rid of the flags registry and not replace it with anything similar.
We don't have a solution yet for the hard coded tables and the hard coded selections but we will deal with these separately.

I will close this issue with wont fix and open one to get rid of the flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants