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

Import cross sections from csv #41

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
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
Jun 23, 2021
d5c8552
fix the imports
Yaxuan-Lii Jun 29, 2021
553738f
removeed irrelevant files
Yaxuan-Lii Jul 1, 2021
5300d62
import is fixed
Yaxuan-Lii Jul 1, 2021
dab091b
try to remove irrelevant fils second time
Yaxuan-Lii Jul 1, 2021
d69d61b
remove irrelevant files second time
Yaxuan-Lii Jul 1, 2021
7984c15
delet irrelevant files
Yaxuan-Lii Jul 1, 2021
66b1c6f
remove irrelevant files
Yaxuan-Lii Jul 1, 2021
4fdafa7
delete .DS_Store
Yaxuan-Lii Jul 1, 2021
dca2d49
Modified test_process_pdos.py
Yaxuan-Lii Jul 2, 2021
eb079f6
add test.py
Yaxuan-Lii Jul 2, 2021
8190183
Restore some files that were accidentally deleted
ajjackson Jul 2, 2021
946efaa
use flake8 to optimise format
Yaxuan-Lii Jul 5, 2021
cd0f3c0
import cross-sections from CSV archives
Yaxuan-Lii Jul 15, 2021
8f48e5e
form modify
Yaxuan-Lii Jul 17, 2021
a959150
modify follow the comments
Yaxuan-Lii Jul 21, 2021
067c289
make corrections
Yaxuan-Lii Jul 21, 2021
a621ab0
make correction
Yaxuan-Lii Jul 21, 2021
13911d0
Revert changes to galore/__init__.py
ajjackson Jul 21, 2021
4fb993d
modified as comments
Yaxuan-Lii Aug 2, 2021
cd4dc0e
merge the change of galore/__init__.py
Yaxuan-Lii Aug 2, 2021
5c9c31c
add cli to install data and get cross sections
Yaxuan-Lii Aug 9, 2021
b138c4b
merge get_cross_sections_from_csv into get_cross_sections
Yaxuan-Lii Aug 10, 2021
bb8a526
modify and add new test
Yaxuan-Lii Aug 24, 2021
5cdb67b
add a IF statement
Yaxuan-Lii Aug 31, 2021
39651d5
modify as comments
Yaxuan-Lii Sep 9, 2021
a2441b5
modify as comments
Yaxuan-Lii Sep 9, 2021
f59b50a
mistakes fix
Yaxuan-Lii Sep 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions galore/cli/galore_get_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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' """)
Copy link
Member

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?

Copy link
Member

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.


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
Copy link
Member

Choose a reason for hiding this comment

The 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))