-
Notifications
You must be signed in to change notification settings - Fork 33
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
Infer reader #48
Merged
Merged
Infer reader #48
Conversation
This file contains 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
The function serpentTools.read / serpentTools.parsers.read will automatically read the requested file, either with the reader passed in or by inferring the file type form the path. Unit tests were added to verify that the appropriate readers were obtained and errors raised if files could not be inferred. Signed-off-by: Andrew Johnson <drewej@protonmail.com>
Signed-off-by: Andrew Johnson <drewej@protonmail.com>
DanKotlyar
approved these changes
Dec 6, 2017
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
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.
Added a function to automatically read the requested file and return the read object. The motivation behind this is to quickly provide access to the data inside a file, with as minimal importing and hoop jumping as possible.
The function
serpentTools.read
, points toserpentTools.parsers.read
, and is capable ofExample
These four cases are all functionally equivalent.