-
Notifications
You must be signed in to change notification settings - Fork 12
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
Import cross sections from csv #41
Draft
Yaxuan-Lii
wants to merge
28
commits into
SMTG-Bham:master
Choose a base branch
from
Yaxuan-Lii:import_cross-sections_from_csv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0a0270c
add test for process_pdos
d5c8552
fix the imports
Yaxuan-Lii 553738f
removeed irrelevant files
Yaxuan-Lii 5300d62
import is fixed
Yaxuan-Lii dab091b
try to remove irrelevant fils second time
Yaxuan-Lii d69d61b
remove irrelevant files second time
Yaxuan-Lii 7984c15
delet irrelevant files
Yaxuan-Lii 66b1c6f
remove irrelevant files
Yaxuan-Lii 4fdafa7
delete .DS_Store
Yaxuan-Lii dca2d49
Modified test_process_pdos.py
Yaxuan-Lii eb079f6
add test.py
Yaxuan-Lii 8190183
Restore some files that were accidentally deleted
ajjackson 946efaa
use flake8 to optimise format
Yaxuan-Lii cd0f3c0
import cross-sections from CSV archives
Yaxuan-Lii 8f48e5e
form modify
Yaxuan-Lii a959150
modify follow the comments
Yaxuan-Lii 067c289
make corrections
Yaxuan-Lii a621ab0
make correction
Yaxuan-Lii 13911d0
Revert changes to galore/__init__.py
ajjackson 4fb993d
modified as comments
Yaxuan-Lii cd4dc0e
merge the change of galore/__init__.py
Yaxuan-Lii 5c9c31c
add cli to install data and get cross sections
Yaxuan-Lii b138c4b
merge get_cross_sections_from_csv into get_cross_sections
Yaxuan-Lii bb8a526
modify and add new test
Yaxuan-Lii 5cdb67b
add a IF statement
Yaxuan-Lii 39651d5
modify as comments
Yaxuan-Lii a2441b5
modify as comments
Yaxuan-Lii f59b50a
mistakes fix
Yaxuan-Lii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,28 +54,33 @@ def get_parser(): | |
Space-separated symbols for elements in material.""") | ||
|
||
parser.add_argument('--dataset', type=str, | ||
help='You can enter "Scofield" or "Yeh"') | ||
help= | ||
"""You can enter 'Scofield' or 'Yeh' """) | ||
|
||
return parser | ||
|
||
|
||
def run(energy, elements, dataset=None): | ||
cross_sections = galore.get_cross_sections(energy, elements, dataset) | ||
logging = galore.cross_sections.cross_sections_info(cross_sections) | ||
logging.info("Photoionisation cross sections per electron:") | ||
if cross_sections is None: | ||
pass | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which scenario is this catching? Could there be a more helpful logging message in that case? Users don't like it when programs do nothing. |
||
else: | ||
logging = galore.cross_sections.cross_sections_info(cross_sections) | ||
logging.info("Photoionisation cross sections per electron:") | ||
|
||
for element in elements: | ||
if 'warning' in cross_sections[element]: | ||
logging.warning(" {0}: {1}".format( | ||
element, cross_sections[element]['warning'])) | ||
else: | ||
orbitals = cross_sections[element] | ||
for element in elements: | ||
|
||
if 'warning' in cross_sections[element]: | ||
logging.warning(" {0}: {1}".format( | ||
element, cross_sections[element]['warning'])) | ||
else: | ||
orbitals = cross_sections[element] | ||
|
||
for orbital, value in orbitals.items(): | ||
if orbital == 'energy': | ||
pass | ||
if value is None: | ||
pass | ||
else: | ||
logging.info(" {0} {1}: {2:.3e}".format(element, | ||
for orbital, value in orbitals.items(): | ||
if orbital == 'energy': | ||
pass | ||
if value is None: | ||
pass | ||
else: | ||
logging.info(" {0} {1}: {2:.3e}".format(element, | ||
orbital, value)) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't clearer than the previous formatting, I think autopep8 is sneaking in again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would still be good to use
choices
here, then Argparse is responsible for handling bad user input.