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

Refactor scripts to tested package #72

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
6cf00ae
added url test idea
shimwell Feb 15, 2022
1dfbb45
added ci with cron job
shimwell Feb 16, 2022
f013cf0
added manual option
shimwell Feb 16, 2022
626f51a
Merge pull request #1 from shimwell/combine_urls_to_ease_testing
shimwell Feb 16, 2022
f676e50
added pytest to ci
shimwell Feb 16, 2022
e623f3c
Merge pull request #2 from shimwell/combine_urls_to_ease_testing
shimwell Feb 16, 2022
22cf71d
added requests
shimwell Feb 16, 2022
1646b84
Merge pull request #3 from shimwell/combine_urls_to_ease_testing
shimwell Feb 16, 2022
c07ef31
Merge branch 'openmc-dev:master' into master
shimwell May 3, 2022
f31cdfd
moved shared extract code to utils
shimwell May 3, 2022
17adc39
removed files from different pr
shimwell May 3, 2022
76436d2
removed unused imports
shimwell May 3, 2022
72bc5b2
added doc string
shimwell May 3, 2022
1157c33
added default output folders
shimwell May 3, 2022
808d76a
added 2021 tendl depletion option
shimwell May 3, 2022
03bd2e5
Merge pull request #1 from openmc-data-storage/adding_folders_to_giti…
shimwell May 10, 2022
a8a1570
Merge pull request #2 from openmc-data-storage/adding_tendl_versions_…
shimwell May 10, 2022
794e1b0
Merge pull request #3 from shimwell/refactor_to_share_extract_functio…
shimwell May 10, 2022
de3e56f
Merge pull request #4 from shimwell/combine_urls_to_ease_testing
shimwell May 10, 2022
07b2093
Merge branch 'main' into develop
shimwell May 10, 2022
4f52053
Merge pull request #5 from openmc-data-storage/develop
shimwell May 10, 2022
a4c7b92
moved files to package layout
shimwell May 10, 2022
9611a9a
removed local installed package files
shimwell May 10, 2022
f32decc
attempt to fix Invalid script entry point error
shimwell May 10, 2022
ef73c5f
returning to console_scripts
shimwell May 10, 2022
21064ed
added main function to allow console script
shimwell May 10, 2022
5fd9e4c
added verbose
shimwell May 10, 2022
b4be4ad
addd pip install package
shimwell May 10, 2022
30dbe78
removed python from command
shimwell May 10, 2022
d38e4bb
added openmc compile
shimwell May 10, 2022
3ae2040
adding hdf5 and todo on lic
shimwell May 10, 2022
fb08263
added sudo to the make install
shimwell May 10, 2022
bee3506
added install for package
shimwell May 10, 2022
4b4c5f0
added .utils for relative path
shimwell May 10, 2022
33c0227
added . for relative path
shimwell May 10, 2022
428d3cf
corrected terminal commands;
shimwell May 10, 2022
6cdb1a5
Merge pull request #6 from openmc-data-storage/converting_to_package
shimwell May 10, 2022
9a57dd4
added install instructions
shimwell May 11, 2022
b5c3d88
added convert tendl
shimwell May 11, 2022
9f47ba5
added jeff32
shimwell May 11, 2022
43fa712
added jeff, fixed tests
shimwell May 11, 2022
da92b52
Merge pull request #7 from openmc-data-storage/converting_to_package
shimwell May 11, 2022
a0bec53
added more scripts to tests
shimwell May 11, 2022
65a5413
removed duplicate entry in scripts
shimwell May 11, 2022
c09b63c
included particle in tendl release details
shimwell May 11, 2022
e50bc0f
added missing relative path
shimwell May 11, 2022
f5638af
added main calls
shimwell May 11, 2022
8fc9bfd
added relative path
shimwell May 11, 2022
74335ff
Merge pull request #8 from openmc-data-storage/converting_to_package
shimwell May 11, 2022
4a6fcbe
added action for test changed scripts
shimwell May 11, 2022
ff3370f
pep8 formatting changes to trigger selective CI
shimwell May 11, 2022
32ee4e3
switch action
shimwell May 11, 2022
7f94c82
fixing change file catching
shimwell May 11, 2022
20c1b4c
added more convert file testing triggers and activate triggers
shimwell May 11, 2022
b3a9743
reduced jeff script from default settings
shimwell May 11, 2022
9515fae
added first depletion script
shimwell May 11, 2022
d57bd73
added temperature to jeff33
shimwell May 11, 2022
a2f2f14
allowed rand tendl to run without user prompt
shimwell May 11, 2022
9637d2b
added tendl rand folder to ignore
shimwell May 11, 2022
710b6ce
added depletion scripts to package
shimwell May 12, 2022
11c62fb
Merge pull request #9 from openmc-data-storage/adding_selective_testing
shimwell May 12, 2022
0095f68
added table for depletion
shimwell May 12, 2022
d41389a
prevent script running accidently during testing
shimwell May 12, 2022
e5bc426
Merge pull request #10 from openmc-data-storage/improved_readme_scrip…
shimwell May 12, 2022
0dee1a9
adding terminal args for chainfile name control
shimwell May 12, 2022
dc4a0e7
Merge pull request #11 from openmc-data-storage/improved_readme_scrip…
shimwell May 12, 2022
3a460de
[skip ci] removed http from link text
shimwell May 12, 2022
691aa94
added nndc to url testing
shimwell May 13, 2022
1b23aae
Merge pull request #12 from openmc-data-storage/adding_nndc_to_urls
shimwell May 13, 2022
407f138
added categories of scripts
shimwell May 13, 2022
ddec987
Merge pull request #13 from openmc-data-storage/improved_readme
shimwell May 13, 2022
e7dd318
adding jeff32 to tests
shimwell May 13, 2022
097e0f7
now testing jeff 3.3 urls
shimwell May 13, 2022
53d4a70
added jendl to test urls
shimwell May 13, 2022
d3873ad
Merge pull request #14 from openmc-data-storage/adding_jeff_to_tests
shimwell May 13, 2022
b28b50d
moved download warning to single function
shimwell May 13, 2022
873d4a5
Merge pull request #15 from openmc-data-storage/standard_warning_mess…
shimwell May 19, 2022
9213227
added other scripts descriptions
shimwell May 19, 2022
1f08bc2
added direct links to download h5 data
shimwell May 19, 2022
f6f24b5
added python publish action
shimwell May 19, 2022
ba329d4
installing from pypi
shimwell May 19, 2022
2995f27
Merge pull request #16 from openmc-data-storage/pypi_based_install
shimwell May 19, 2022
6860890
new folder arrangement
shimwell May 19, 2022
cd578db
added download script to test
shimwell May 19, 2022
bf0b4bb
added init for new folder
shimwell May 19, 2022
107d7e3
[skip ci] reordered script testing
shimwell May 19, 2022
3ed395f
importing from package
shimwell May 19, 2022
fdada55
importing from package
shimwell May 19, 2022
d93dfc1
Merge pull request #17 from openmc-data-storage/adding_download_scripts
shimwell May 19, 2022
0c67778
added missing b
shimwell May 19, 2022
fac754b
Merge pull request #18 from openmc-data-storage/correcting_release_name
shimwell May 20, 2022
f054ddc
added download nndc chain
shimwell May 20, 2022
c5e5601
added existance test for chain downloader
shimwell May 20, 2022
3c0e354
added filename option
shimwell May 20, 2022
849229a
renamed chain file
shimwell May 20, 2022
dd354bd
renamed chain file
shimwell May 20, 2022
84503a9
added download script testing to test suit
shimwell May 20, 2022
8c4b4df
[skip ci] fixed import
shimwell May 20, 2022
0d70b22
added h5 to url tests
shimwell May 20, 2022
633eaee
corrected varible name
shimwell May 20, 2022
ebac4a1
added chain dict
shimwell May 20, 2022
a4add38
Merge pull request #19 from openmc-data-storage/adding_chain_file_dow…
shimwell May 20, 2022
b520533
[skip ci] indented
shimwell May 20, 2022
512c046
Merge pull request #20 from openmc-data-storage/adding_chain_file_dow…
shimwell May 23, 2022
cddd477
allowing zip file downloads
shimwell May 23, 2022
1c5f1fa
Merge pull request #21 from openmc-data-storage/fixing_zip_bug
shimwell May 23, 2022
a153449
[skip ci] corected typo in table
shimwell May 24, 2022
a204387
[skip ci] added combine script
shimwell May 24, 2022
662bff9
Added same lic as original repo
shimwell Jun 1, 2022
fda4e26
made use of utils.download
shimwell Jun 9, 2022
388254e
extract allows single file and iterable
shimwell Jun 9, 2022
397cc2f
renamed endf chain script filename
shimwell Jun 9, 2022
62257bf
added endf 8 release
shimwell Jun 9, 2022
16ffd7f
corrected finding files and xml output path
shimwell Jun 9, 2022
8e0b5a4
Merge pull request #22 from openmc-data-storage/adding_ENDFB-VIII.0_c…
shimwell Jun 9, 2022
e71242d
renamed script name
shimwell Jun 9, 2022
c34fc0b
[skip ci] renamed script
shimwell Jun 9, 2022
edb6ef1
[skip ci] added endf xml chains
shimwell Jun 9, 2022
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
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This yml file will trigger a Github Actions event that builds and upload the
# Python package to PiPy. This makes use of Twine and is triggered when a push
# to the main branch occures. For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# and for details on the Autobump version section see:
# https://github.com/grst/python-ci-versioneer

name: Upload Python Package

on:
# allows us to run workflows manually
workflow_dispatch:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build twine

- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine check dist/*
twine upload dist/*
82 changes: 82 additions & 0 deletions .github/workflows/test_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

name: test_existence
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main


jobs:
run_scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install testing dependencies
run: |
sudo apt-get install libhdf5-serial-dev
git clone --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git
cd openmc
mkdir build
cd build
cmake ..
make -j2
sudo make -j2 install
cd ..
pip install .
cd ..
pip install .

# this just check the scripts are accessible after the install
# the scripts are not run or checked for correct behaviour
- name: Test convert scripts exist
run: |
convert_fendl --help
convert_jeff32 --help
convert_jeff33 --help
convert_lib80x --help
convert_mcnp70 --help
convert_mcnp71 --help
convert_nndc71 --help
convert_tendl --help

- name: Test generate scripts exist
run: |
generate_cendl --help
generate_endf --help
generate_jeff33 --help
generate_jendl --help

- name: Test download h5 scripts exist
run: |
download_nndc --help

- name: Test download chain files scripts exist
run: |
download_nndc_chain --help

- name: Test other scripts exist
run: |
combine_libraries --help
convert_tendl_rand --help
# make_compton --help commented out as the script needs adapting
# make_stopping_powers --help commented out as the script needs adapting
sample_sandy --help

- name: Test depletion scripts exist
run: |
add_branching_ratios --help
generate_endf71_chain_casl --help
generate_endf_chain --help
generate_serpent_fissq --help
generate_tendl_chain --help
reduce_chain --help
104 changes: 104 additions & 0 deletions .github/workflows/test_processing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

name: test_convert_scripts
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main


jobs:
run_scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v19
with:
files: |
openmc_data/convert/convert_*.py
openmc_data/download/download_*.py

- name: Set up Python
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install testing dependencies
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
sudo apt-get install libhdf5-serial-dev
git clone --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git
cd openmc
mkdir build
cd build
cmake ..
make -j2
sudo make -j2 install
cd ..
pip install .
cd ..
pip install .

# convert scripts that require mcnp nuclear data are not tested when the
# contents change as the CI doesn't contain that nuclear data.
# convert_lib80x.py convert_mcnp70.py convert_mcnp71.py files are not tested here

- name: test default convert_fendl
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert_fendl.py')
run: |
echo "convert_fendl.py file has been modified."
convert_fendl --cleanup

# this running convert_jeff32 in with default arguments produces 49GB of
# data. Hence the use of arguments to process just one temperature
- name: test default convert_jeff32
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert/convert_jeff32.py')
run: |
echo "convert_jeff32.py file has been modified."
convert_jeff32 -r 3.2 -t 293 --cleanup

- name: test default convert_jeff33
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert/convert_jeff33.py')
run: |
echo "convert_jeff33.py file has been modified."
convert_jeff33 -r 3.3 -t 293 --cleanup

- name: test default convert_nndc71
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert/convert_nndc71.py')
run: |
echo "convert_nndc71.py file has been modified."
convert_nndc71 --cleanup

- name: test default convert_tendl
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert/convert_tendl.py')
run: |
echo "convert_tendl.py file has been modified."
convert_tendl --cleanup

- name: test default convert_tendl_rand
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/convert/convert_tendl_rand.py')
run: |
echo "convert_tendl_rand.py file has been modified."
convert_tendl_rand --nuclides O16 --cleanup

# download scripts
- name: test default download_nndc
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/download/download_nndc.py')
run: |
echo "download_nndc.py file has been modified."
download_nndc

- name: test default download_nndc_chain
if: contains(steps.changed-files-specific.outputs.modified_files, 'openmc_data/download/download_nndc_chain.py')
run: |
echo "download_nndc_chain.py file has been modified."
download_nndc_chain
45 changes: 45 additions & 0 deletions .github/workflows/test_urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

name: test_urls
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
# cron job runs every day

jobs:
ping_urls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install testing dependencies
run: |
sudo apt-get install libhdf5-serial-dev
git clone --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git
cd openmc
mkdir build
cd build
cmake ..
make -j2
sudo make -j2 install
cd ..
pip install .
cd ..
pip install .[tests]

# the -s allows normal print statements in the url testing to be seen in
# the pytest output
- name: test urls
run: |
pytest -v -s tests/test_urls.py
Loading