Skip to content

Commit

Permalink
Merge branch 'master' into test_new_EFIT_mappings_for_IDA
Browse files Browse the repository at this point in the history
  • Loading branch information
AreWeDreaming committed Jun 26, 2024
2 parents a06c7d8 + 65e8238 commit bc99513
Show file tree
Hide file tree
Showing 377 changed files with 880,277 additions and 39,960 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@ jobs:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
# 3.12 does not yet work because numpy removed numpy.distutils that pygacode relies on

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.6'
python-version: ${{ matrix.python-version }}
cache: 'pip'


- name: Extra dependencies required for 3.7
if: ${{matrix.python-version == '3.7'}}
run: |
sudo apt-get update
sudo apt-get install libhdf5-dev libnetcdf-dev
- name: Install numpy
run: |
Expand All @@ -32,7 +43,18 @@ jobs:
run: |
python3 -m pip install -r requirements.txt
- name: Install OMAS
# numpy is a build time dependency of pygacode
# but before pygacode 1.0 it did not specify its build dependencies correctly
# and pygacode requires python >= 3.8,
# so for 3.7 we need to build without build isolation and manually install numpy
- name: Install OMAS (Py 3.7)
if: ${{matrix.python-version == '3.7'}}
run: |
python3 -m pip install wheel
python3 -m pip install --no-build-isolation .[machine]
- name: Install OMAS (normal)
if: ${{matrix.python-version != '3.7'}}
run: |
python3 -m pip install .[machine]
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
# Do not mark issues with these labels
exempt-issue-labels: "bug,enhancement,WIP"
stale-issue-message: >
This issue has not seen any activity in the past 60 days.
It is now marked as stale and will be closed in 7 days if
no further activity is registered.
# Do not mark PRs with these labels
exempt-pr-labels: 'WIP,Blocked-by-other-PR'
stale-pr-message: >
This PR has not seen any activity in the past 60 days.
It is now marked as stale and will be closed in 7 days if
no further activity is registered.
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 60
days-before-close: 21
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ testpypi:
hash:
pip hash dist/omas-$(VERSION).tar.gz

release: tests requirements json cocos docs tag
release: test requirements json cocos docs tag
@echo 'Make release done'

fmt:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![OMAS version](https://img.shields.io/github/tag-date/gafusion/omas.svg?label=OMAS&color=blue)
![IMAS version](https://img.shields.io/badge/IMAS-3.39.0-yellow)
![IMAS version](https://img.shields.io/badge/IMAS-3.41.0-yellow)

![GitHub repo size](https://img.shields.io/github/repo-size/gafusion/omas.svg?color=blue)

Expand Down
8 changes: 4 additions & 4 deletions omas/examples/connect_gkdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# load a sample GKDB sample json file
sample_filename = omas_dir + 'samples/gkdb_linear_eigenvalue.json'
ods = ODS()
# warn about `gyrokinetics.fluxes_integrated_norm = []` and drop it
ods['gyrokinetics'].load(sample_filename, consistency_check='warn_drop')
# warn about `gyrokinetics_local.fluxes_integrated_norm = []` and drop it
ods['gyrokinetics_local'].load(sample_filename, consistency_check='warn_drop')

# show content
pprint(ods.pretty_paths())
Expand All @@ -29,11 +29,11 @@

__file__ = inspect.getfile(lambda: None)
filename = omas_testdir(__file__) + '/gkdb_linear_initialvalue.json'
ods['gyrokinetics'].save(filename)
ods['gyrokinetics_local'].save(filename)

# load the newly saved copy
ods1 = ODS()
ods1['gyrokinetics'].load(filename)
ods1['gyrokinetics_local'].load(filename)

# look for differences between original GKDB json and OMAS json
differences = ods.diff(ods1, ignore_type=True)
Expand Down
4 changes: 2 additions & 2 deletions omas/examples/omas_mongo_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
print('load a sample GKDB sample json file')
sample_filename = omas_dir + 'samples/gkdb_linear_eigenvalue.json'
ods = ODS()
# warn about `gyrokinetics.fluxes_integrated_norm = []` and drop it
ods['gyrokinetics'].load(sample_filename, consistency_check='warn_drop')
# warn about `gyrokinetics_local.fluxes_integrated_norm = []` and drop it
ods['gyrokinetics_local'].load(sample_filename, consistency_check='warn_drop')

print('write GKDB entry to the database')
_id = ods.save('mongo', collection='gkdb', database='test')
Expand Down
2 changes: 1 addition & 1 deletion omas/examples/omas_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# how to manipulate data that has units
ods.sample()
with omas_environment(ods, unitsio=True):
ne = ods['core_profiles.profiles_1d.0.electrons.density']
ne = ods['core_profiles.profiles_1d.0.electrons.density_thermal']
print(f'Mean density in m^-3: {numpy.mean(ne.to("m^-3").magnitude):3.3g}')
print(f'Mean density in cm^-3: {numpy.mean(ne.to("cm^-3").magnitude):3.3g}')

Expand Down
Loading

0 comments on commit bc99513

Please sign in to comment.