Conversation
added 15 commits
February 20, 2020 09:58
…le and --output_file
…or get_shortcuts(c)
Codecov Report
@@ Coverage Diff @@
## devel #353 +/- ##
==========================================
- Coverage 39.64% 39.32% -0.33%
==========================================
Files 81 84 +3
Lines 24363 24584 +221
==========================================
+ Hits 9659 9667 +8
- Misses 14704 14917 +213
Continue to review full report at Codecov.
|
lasofivec
approved these changes
Feb 21, 2020
| url="https://github.com/ToFuProject/tofu", | ||
| # Author details | ||
| author="Didier VEZINET", | ||
| author="Didier VEZINET and Laura MENDOZA", |
| from tofu.imas2tofu._mat2ids2calc import * | ||
| except Exception: | ||
| from ._core import * | ||
| from ._mat2ids2calc import * |
Collaborator
There was a problem hiding this comment.
is there a reason why you do an "import *" ? is it just because the file is small?
I'm still approving the PR :)
Member
Author
There was a problem hiding this comment.
It's because the file is small and also because it contains a very specific use-case that may get generalized later, in which case we'll be happy to have it in a separate module that we can import (becasue it would then get bigger)
Thanks !
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivations:
The default shortcuts used by tf.imas2tofu.MultiIDSLoader may vary frequently due to regular updates to the IMAS data dictionnnary.
Users should be able to update the shortcuts themselves without having to wait for an official to tofu.
Currently, the shortcuts are stored in a (large) hard-coded dictionnary in a dedicated module.
An elegant solution would be to mimic ipython's way of customizing preferences:
create a script tofu-custom that can copy a local version of that module in the user's home, in a dedicated hidden directory:
~/.tofu/copy in this directory the module with an explicit name _imas2tofu_shortcuts.py or something similar.
Make sure that when tofu imports the dict from the module, it looks first into this local version and then into the general install, to make sure the user's version has precedence over the general version
Main changes:
tofu-customimplemented in thesetup.py.~/.tofu/in the user's home, and copies files containing default tofu parameters in it (at this point there is only one file_imas2tofu_def.py, but more may come in the future). The user is free to edit these files.tofu.imas2tofufirst checks whether the user has local default parameters before loading the general tofu parameters.N.B.: the names of the files is
_modulename_def.pyIssues:
Fixes, in devel, Issue #351