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

Remove settings package; Cleaned up messages file #47

Merged
merged 2 commits into from
Dec 6, 2017

Conversation

drewejohnson
Copy link
Collaborator

Wasn't a need for the settings directory, so it has been refactored out. The following files were moved, in reference to the root serpentTools directory

  1. settings/__init__.py --> settings.py
  2. settings/messages.py --> messages.py
  3. settings/variables.yaml --> variables.yaml

The setup.py script was modified to remove the serpentTools.settings package, and move the variables file to/from the correct place upon install.
All calls to the settings package, i.e. from serpentTools.settings import rc still work, but the message imports had to be modified to point towards serpentTools.messages. The latter change is the cause for most of the files being modified

Changes to messages.py

There is not longer a single error function with an optional fatal argument. There is now the error and critical functions. The difference is that error should be used if an exception was suppressed internally, while the critical function should be used in the event of a serious failure. Perhaps bundled inside the SerpentToolsException class?

Also, the now correctly named deprecated decorator takes an argument on use.

@deprecated('alternativeFunc')
def foo(x, y):
     print(x * y)

foo(1, 2)
WARNING : serpentTools: Function foo has been deprecated. Use alternativeFunc instead
DeprecationWarning: Function foo has been deprecated. Use alternativeFunc instead
2

There isn't really a huge point to ahave a separate directory and package for the settings. The settings/__init__.py file has been moved to settings.py, and messages.py and variables.yaml have also been moved to the root directory.

Signed-off-by: Andrew Johnson <drewej@protonmail.com>
… either

Signed-off-by: Andrew Johnson <drewej@protonmail.com>
@drewejohnson drewejohnson merged commit f0ede3b into develop Dec 6, 2017
@drewejohnson drewejohnson deleted the remove-settings-package branch December 6, 2017 16:49
drewejohnson added a commit that referenced this pull request Dec 13, 2017
* Updated gitignore to exclude pycharm project settings
* Skeleton files for each reader class; Basic directory setup
* Depletion reader and project settings (#1)
* Quick: DepletedMaterial returns time vector if not given as input (#2)
* Quick fix: DepletedMaterial getXY only returns time if no time is given as input
* Fixes #3; Cleaned up reader subclasses (#4)
* Fixes #3; Cleaned up reader subclasses
* Added versioneer (#18)
* Fix get xy (#21)
* Fixes #19: Material doesn't return days if given as input
* Fixed unit tests
* Versioneer (#23)
* Messages, logging, and exception (#24)
* Expand variable groups; XSReader base; Temporary settings  (#27)
* Branching testing; Temporary settings modification
* Initial documentation - sphinx (#28)
* Added variables.yaml to data_files in setup (#32)
* Added depreciation and future warning decorators; More debug statements (#34)
* Depletion reader now correctly adds data from TOT; Updated defaults (#39)
* Better support (#40)
* Added python 2.7 support (#41)
* Homogenized Universe (#35)
* Read depmtx (#44)
* Return A matrix from depmtx as csc matrix not csr (#46)
* Remove settings package; Cleaned up messages file (#47)
* Implemented a module level read function (#48)
* Examples (#49)
* depmtx reader now parses using regular expressions (#52)
* Updated documentation - developer guide, api, and examples (#59)
* Updated setup.py to begrudgingly support distutils (#61)
* Use warnings.catch_warnings to record warnings in test_settings (#55)
* Native drewtils (#62)
* Branching Reader (#65)
* Release 0.1.0
drewejohnson added a commit that referenced this pull request Dec 13, 2017
* Release 0.1.0 (#66)

* Updated gitignore to exclude pycharm project settings
* Skeleton files for each reader class; Basic directory setup
* Depletion reader and project settings (#1)
* Quick: DepletedMaterial returns time vector if not given as input (#2)
* Quick fix: DepletedMaterial getXY only returns time if no time is given as input
* Fixes #3; Cleaned up reader subclasses (#4)
* Fixes #3; Cleaned up reader subclasses
* Added versioneer (#18)
* Fix get xy (#21)
* Fixes #19: Material doesn't return days if given as input
* Fixed unit tests
* Versioneer (#23)
* Messages, logging, and exception (#24)
* Expand variable groups; XSReader base; Temporary settings  (#27)
* Branching testing; Temporary settings modification
* Initial documentation - sphinx (#28)
* Added variables.yaml to data_files in setup (#32)
* Added depreciation and future warning decorators; More debug statements (#34)
* Depletion reader now correctly adds data from TOT; Updated defaults (#39)
* Better support (#40)
* Added python 2.7 support (#41)
* Homogenized Universe (#35)
* Read depmtx (#44)
* Return A matrix from depmtx as csc matrix not csr (#46)
* Remove settings package; Cleaned up messages file (#47)
* Implemented a module level read function (#48)
* Examples (#49)
* depmtx reader now parses using regular expressions (#52)
* Updated documentation - developer guide, api, and examples (#59)
* Updated setup.py to begrudgingly support distutils (#61)
* Use warnings.catch_warnings to record warnings in test_settings (#55)
* Native drewtils (#62)
* Branching Reader (#65)
* Release 0.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants