Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1008 commits
Select commit Hold shift + click to select a range
251ba62
improving dummy files
falconstryker Mar 28, 2025
a09cd43
improving dummy files
falconstryker Mar 28, 2025
1f95f52
improving dummy files
falconstryker Mar 28, 2025
769663f
improving dummy files
falconstryker Mar 28, 2025
9de4605
improving dummy files
falconstryker Mar 28, 2025
91008c8
improving dummy files
falconstryker Mar 28, 2025
3a55075
improving dummy files
falconstryker Mar 28, 2025
17bcf65
improving dummy files
falconstryker Mar 28, 2025
e355a0f
debugging marsformat test
falconstryker Mar 28, 2025
e27e7c5
debugging marsformat test
falconstryker Mar 28, 2025
0d24a75
fixing marsformat.py PCM handling for dimension swap
falconstryker Mar 28, 2025
5362446
numerical instability in phalf calc for pcm, fixing in fv3_utils
falconstryker Mar 28, 2025
f0649f1
undoing the change in fv3_utils, implementing linear interpolation in…
falconstryker Mar 28, 2025
f23549c
double checking ak bk calculations
falconstryker Mar 28, 2025
72789fc
use bp and ap for bk and ak
falconstryker Mar 28, 2025
d77a74c
using bp and ap to calculate phalf
falconstryker Mar 28, 2025
cdf7ec8
adding check to make sure vertical dim is not flipped twice
falconstryker Mar 28, 2025
4c59dd5
adding check to make sure vertical dim is not flipped twice
falconstryker Mar 28, 2025
98c0868
cleaning up marsformat after changes
falconstryker Mar 28, 2025
5d4048b
marswrf -ba fails on the renamed variables but succeeds if using -rn …
falconstryker Mar 28, 2025
621a3fd
marswrf -ba fails on the renamed variables but succeeds if using -rn …
falconstryker Mar 28, 2025
facb882
testing solution to bin_average timestep issue
falconstryker Mar 28, 2025
6b81065
adding timestep check for bin_diurn too
falconstryker Mar 28, 2025
7abac75
pcm working with bin_diurn without -rn but not with -rn. related to a…
falconstryker Mar 28, 2025
93aa862
pcm working with bin_diurn without -rn but not with -rn. related to a…
falconstryker Mar 28, 2025
7119159
pcm working with bin_diurn without -rn but not with -rn. related to a…
falconstryker Mar 28, 2025
3b3ece9
dealing with amescap_profile variable name mapping to gcms
falconstryker Mar 31, 2025
1f27e60
dealing with amescap_profile variable name mapping to gcms
falconstryker Mar 31, 2025
4546694
dealing with amescap_profile variable name mapping to gcms
falconstryker Mar 31, 2025
c39a5b7
dealing with amescap_profile variable name mapping to gcms
falconstryker Mar 31, 2025
34daeb6
dealing with amescap_profile variable name mapping to gcms
falconstryker Mar 31, 2025
adbdece
bin_diurn with custom bin_average wasn't being called. fixed if state…
falconstryker Mar 31, 2025
08429a0
bin_diurn with custom bin_average wasn't being called. fixed if state…
falconstryker Mar 31, 2025
f6e4210
bin_diurn with custom bin_average wasn't being called. fixed if state…
falconstryker Mar 31, 2025
f85ea09
issues finding 'time' in the output files for the test, fixing
falconstryker Mar 31, 2025
393cc2a
testing on dummy files
falconstryker Mar 31, 2025
164c325
trying github actions test
falconstryker Mar 31, 2025
987fa65
optimizing MarsFormat tests
falconstryker Apr 8, 2025
82d0140
optimizing MarsFormat tests
falconstryker Apr 8, 2025
a300065
optimizing MarsFormat tests
falconstryker Apr 8, 2025
92f3dec
optimizing MarsFormat tests
falconstryker Apr 8, 2025
0ef0828
optimizing MarsFormat tests
falconstryker Apr 8, 2025
3a6146a
reverting back to working (locally) version of test_marsformat
falconstryker Apr 9, 2025
d35bc80
reverting back to working (locally) version of test_marsformat
falconstryker Apr 9, 2025
bfe48a4
explicitly defining marswrf dummy data vertical vars
falconstryker Apr 9, 2025
3d7d2ed
cleaned up time_shift_calc to be more self explanatory
falconstryker Apr 10, 2025
5684e20
locally, test_marsformat works. testing actions
falconstryker Apr 10, 2025
4efe538
cleaning up disk space in test_marsformat
falconstryker Apr 10, 2025
70186b9
improving Ames MGCM dummy file creation
falconstryker Apr 11, 2025
2c6c6b6
debugging ames mgcm dummy file creation
falconstryker Apr 11, 2025
ef4134c
debugging ames mgcm dummy file creation
falconstryker Apr 11, 2025
4f8895b
updating command line messages for extract
falconstryker Apr 18, 2025
d4fdb60
updating command line messages for extract
falconstryker Apr 18, 2025
722153c
accepting average file for ak and bk instead of just fixed
falconstryker Apr 18, 2025
40384ab
making sure phalf also indicated a non-interpolated file
falconstryker Apr 18, 2025
67a6e16
making sure phalf also indicated a non-interpolated file
falconstryker Apr 18, 2025
291c632
making sure phalf also indicated a non-interpolated file
falconstryker Apr 18, 2025
f7cf6a2
making sure phalf also indicated a non-interpolated file
falconstryker Apr 18, 2025
c43e9f1
Merge branch 'devel' into devel
falconstryker Apr 18, 2025
fd6b09f
Merge pull request #25 from NASA-Planetary-Science/devel
falconstryker Apr 18, 2025
6bfb68b
Merge pull request #95 from falconstryker/devel
rurata Apr 21, 2025
1353924
removed pyshtools from devel, its now in feature branch 'pyshtools'
falconstryker Apr 21, 2025
9b43864
Merge pull request #96 from falconstryker/devel
rurata Apr 21, 2025
0876974
fixed split issue on diurn files
rurata Apr 21, 2025
91b36c3
Merge pull request #97 from rurata/devel
falconstryker Apr 21, 2025
e2f5cec
added note in install instructions on how to install specific branch
falconstryker Apr 21, 2025
5db6220
testing marsfiles test
falconstryker Apr 21, 2025
20ef649
testing marsfiles test
falconstryker Apr 21, 2025
8505298
fixed areo print formatting for diurn files in inspect
rurata Apr 21, 2025
1c3bacd
Merge branch 'NASA-Planetary-Science:devel' into devel
rurata Apr 21, 2025
3a7203c
testing marsfiles test
falconstryker Apr 21, 2025
49a92d5
testing marsfiles test
falconstryker Apr 21, 2025
eca8bce
testing marsfiles test
falconstryker Apr 21, 2025
2d11964
testing marsfiles test
falconstryker Apr 21, 2025
557c7e3
testing marsfiles test
falconstryker Apr 21, 2025
d21f78c
areo values were defined wrong in create_ames_gcm_files
falconstryker Apr 21, 2025
1ccfa8d
Merge pull request #101 from falconstryker/devel
rurata Apr 22, 2025
8ddc1c6
Merge branch 'NASA-Planetary-Science:devel' into devel
rurata Apr 22, 2025
552d15c
Merge pull request #99 from rurata/devel
falconstryker Apr 22, 2025
1c735b0
fixed areo def in dummy file creation
falconstryker Apr 22, 2025
5f7cf01
fixed areo def in dummy file creation
falconstryker Apr 22, 2025
c44ec1d
fixed areo def in dummy file creation
falconstryker Apr 22, 2025
2aed367
fixed areo def in dummy file creation
falconstryker Apr 22, 2025
29c685f
Merge pull request #102 from falconstryker/devel
rurata Apr 22, 2025
3c9538d
debugging marsfiles test
falconstryker Apr 23, 2025
82c53b5
debugging marsfiles test
falconstryker Apr 23, 2025
cfbd8da
issues in time_shift with integer v floats
falconstryker Apr 23, 2025
029accb
finished test_marsfiles.py. creating yml script for github actions
falconstryker Apr 23, 2025
bff18a6
parallelizing the github actions yml script for marsfiles
falconstryker Apr 23, 2025
338eae3
parallelizing github actions marsiles, adding windows
falconstryker Apr 23, 2025
2fa6a22
parallelizing github actions marsiles, adding windows
falconstryker Apr 23, 2025
7c3d3ec
troubleshooting github actions for marsfiles
falconstryker Apr 23, 2025
7d33b40
troubleshooting github actions for marsfiles
falconstryker Apr 23, 2025
ed9af9a
troubleshooting github actions for marsfiles
falconstryker Apr 23, 2025
2c1749d
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
79f9de0
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
b7adff3
MarsPlot testing (#103)
rurata Apr 24, 2025
92fadcd
Merge branch 'NASA-Planetary-Science:devel' into devel
falconstryker Apr 24, 2025
801f341
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
56901f2
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
36767b3
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
f80519a
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
a13fb34
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
4cb8697
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
5eed3c5
making marsfiles compatible cross-platform
falconstryker Apr 23, 2025
eb29603
debugging marsfiles paths
falconstryker Apr 25, 2025
6b0a4ea
debugging marsfiles paths
falconstryker Apr 25, 2025
6f1a38a
debugging marsfiles paths
falconstryker Apr 25, 2025
b4b3a6c
debugging marsfiles paths
falconstryker Apr 25, 2025
20dc338
debugging marsfiles paths
falconstryker Apr 25, 2025
a6147f6
debugging marsfiles paths
falconstryker Apr 25, 2025
a3be79d
debugging marsfiles paths
falconstryker Apr 25, 2025
4d9d248
debugging marsfiles paths
falconstryker Apr 25, 2025
b38353a
debugging marsfiles paths
falconstryker Apr 25, 2025
f0068ff
increasing timeout on github actions
falconstryker Apr 25, 2025
4374b09
increasing timeout on github actions
falconstryker Apr 25, 2025
547508c
removing ghostscript from requirements for making pdfs
falconstryker Apr 28, 2025
815d6f8
Merge pull request #104 from falconstryker/devel
rurata Apr 28, 2025
8891401
optional short files for create_ames_gcm_files.py (#105)
rurata Apr 28, 2025
0a4d710
MarsInterp testing (#106)
rurata Apr 29, 2025
4217ebd
adding integration test for marsvars
falconstryker Apr 28, 2025
b37c3c3
adding ice_mass_micro and dst_num_micro to dummy files for testing ma…
falconstryker Apr 28, 2025
2146c5e
removed attempt at dmget from script utils
falconstryker Apr 28, 2025
01bb61b
updating test for marsvars. also adding w and omega to pstd dummy file
falconstryker Apr 28, 2025
74e6262
updated install instructions date
falconstryker Apr 29, 2025
7548bcb
updating marsvars test
falconstryker Apr 29, 2025
17eb6b4
updated troubleshooting for windows (#107)
rurata Apr 29, 2025
7ad0c3d
Merge branch 'NASA-Planetary-Science:devel' into devel
falconstryker Apr 29, 2025
bf63d7c
troubleshooting marsplot inspect
falconstryker Apr 29, 2025
2cae723
troubleshooting marsplot inspect
falconstryker Apr 29, 2025
1feff2d
marsplot issue was related to changes in check_file_tape in Script_ut…
falconstryker Apr 29, 2025
c31b85d
adding possibility that dst_mass_mom is named dst_mass_micro in marsvars
falconstryker Apr 29, 2025
6134fd0
adding possibility that dst_mass_mom is named dst_mass_micro in marsvars
falconstryker Apr 29, 2025
8db5185
adding omega to dummy average file, adjusting test_Marsvars.py
falconstryker Apr 29, 2025
205b828
adding omega to dummy average file, adjusting test_Marsvars.py
falconstryker Apr 29, 2025
b61d46c
adding omega to dummy average file, adjusting test_Marsvars.py
falconstryker Apr 29, 2025
e6d815e
adding checks for dependent variables in marsvars
falconstryker Apr 29, 2025
8079a0a
adding checks for dependent variables in marsvars
falconstryker Apr 29, 2025
50b4ac4
troubleshooting marsvars add
falconstryker Apr 29, 2025
cc6d3be
troubleshooting marsvars add
falconstryker Apr 29, 2025
7853044
troubleshooting marsvars add
falconstryker Apr 29, 2025
09d384a
troubleshooting marsvars add
falconstryker Apr 29, 2025
72a9c94
troubleshooting marsvars add
falconstryker Apr 29, 2025
ad883da
troubleshooting marsvars add
falconstryker Apr 29, 2025
44145ec
troubleshooting marsvars add
falconstryker Apr 29, 2025
88be6a3
troubleshooting marsvars add
falconstryker Apr 29, 2025
74def40
troubleshooting marsvars add
falconstryker Apr 29, 2025
5592b7f
troubleshooting marsvars add
falconstryker Apr 30, 2025
11ae1e1
troubleshooting dp to dz
falconstryker Apr 30, 2025
8b033e3
troubleshooting test_marsvars
falconstryker Apr 30, 2025
9f76162
updating test_marsvars.py
falconstryker May 5, 2025
371cfba
updating test_marsvars.py
falconstryker May 5, 2025
ee7fd35
adding theta and rho to dummy average pstd file
falconstryker May 5, 2025
feeab7f
fixing -rm which was broken
falconstryker May 5, 2025
09bc8cf
fixing test_marsvars edit test
falconstryker May 5, 2025
bdef8af
debugging marsvars test
falconstryker May 5, 2025
118aa52
fixing zonal mean test
falconstryker May 5, 2025
eb45504
adding yml file to do github actions for marsvars
falconstryker May 5, 2025
1b7797d
small update to yml files for marspull and marscalendar to deal with …
falconstryker May 5, 2025
0cfd66f
small updates to yml file formatting
falconstryker May 5, 2025
328153b
updating marsvars to handle file paths in any OS
falconstryker May 5, 2025
fcbebf9
troubleshooting windows tests for marsvars
falconstryker May 5, 2025
38ea7d5
troubleshooting windows tests for marsvars
falconstryker May 5, 2025
defeb90
troubleshooting windows tests for marsvars
falconstryker May 5, 2025
3cfecf7
troubleshooting windows tests for marsvars
falconstryker May 5, 2025
3dff278
cleaning up marsvars
falconstryker May 5, 2025
ae3c055
Merge pull request #108 from falconstryker/devel
rurata May 5, 2025
c5841f0
Pyshtools (#26)
falconstryker May 7, 2025
b849ee9
trying to improve marsfiles test times
falconstryker May 7, 2025
25bfbfb
mismatch in argument names bw MarsFiles and FV3_utils
falconstryker May 7, 2025
292155a
install pyshtools version for marsfiles tests
falconstryker May 7, 2025
3f793a0
troubleshooting github actions
falconstryker May 7, 2025
c6f647b
updating tide amp normalized long name
falconstryker May 7, 2025
a4cf1d0
making marsfiles compatible accross OSes
falconstryker May 7, 2025
9415e2f
speeding up marsfiles test
falconstryker May 7, 2025
66c8f75
debugging marsfiles test
falconstryker May 8, 2025
1b08b6c
debugging marsfiles test
falconstryker May 8, 2025
00cae18
adding confirmation notes to marsfiles test
falconstryker May 8, 2025
4bf908c
streamline test class (#109)
rurata May 8, 2025
aa79f57
making marsfiles test more efficient
falconstryker May 8, 2025
bbbdd46
debugging marsfiles test
falconstryker May 9, 2025
6a829dc
debugging marsfiles test
falconstryker May 9, 2025
ae20ecf
Merge branch 'devel' into devel
falconstryker May 9, 2025
f78d77c
streamline test class (#109) (#27)
falconstryker May 9, 2025
ade1149
using short files for marsfiles test
falconstryker May 9, 2025
b668cb2
Merge branch 'NASA-Planetary-Science:devel' into devel
falconstryker May 12, 2025
55507b2
Merge pull request #110 from falconstryker/devel
rurata May 12, 2025
376719d
updating paper draft with bibliography (#111)
rurata May 12, 2025
13d1239
updating dates (#112)
falconstryker May 12, 2025
a7002d4
updating test matrix for MarsFiles
falconstryker May 12, 2025
d1a19e6
updating test matrix for MarsFiles
falconstryker May 12, 2025
61ac725
minor formatting changes to paper
falconstryker May 12, 2025
5759ce0
Merge pull request #113 from falconstryker/devel
rurata May 12, 2025
7ab3e3e
update paper formatting
rurata May 12, 2025
f9d885e
Merge pull request #114 from rurata/devel
falconstryker May 12, 2025
9a5df69
comment cleanup, docstring formatting, whitespace cleanup
falconstryker May 14, 2025
45f758b
Merge pull request #115 from falconstryker/devel
rurata May 15, 2025
bca7209
updating marspull -list
falconstryker May 15, 2025
afbf217
updating marspull -list
falconstryker May 15, 2025
93cb9ce
updating marspull -list
falconstryker May 15, 2025
8889538
updating marspull -list
falconstryker May 15, 2025
69560a1
updating marspull -list
falconstryker May 15, 2025
7a0cf12
updating marspull -list
falconstryker May 15, 2025
eecc325
updating marspull -list
falconstryker May 15, 2025
6525179
updating marspull -list
falconstryker May 15, 2025
afa07e1
updating marspull -list
falconstryker May 15, 2025
3689ffc
updating marspull -list
falconstryker May 15, 2025
ab5a334
updating marspull -list
falconstryker May 15, 2025
ac65d26
updating marspull -list
falconstryker May 15, 2025
0fbb8b3
updating marspull -list
falconstryker May 15, 2025
434d6ad
updating marspull -list
falconstryker May 15, 2025
77e5092
updating marspull -list
falconstryker May 15, 2025
791284b
updating marspull -list
falconstryker May 15, 2025
be0b7fa
updating marspull -list
falconstryker May 15, 2025
016c88f
updating marspull -list
falconstryker May 15, 2025
8d0cc17
updating marspull -list
falconstryker May 15, 2025
e66bdb6
updating marspull -list
falconstryker May 15, 2025
eb46a14
updating marspull -list
falconstryker May 15, 2025
14cabe3
updating marspull -list
falconstryker May 15, 2025
fbbf9e4
updating marspull -list
falconstryker May 15, 2025
56239eb
updating marspull -list
falconstryker May 15, 2025
aaa7ecf
updating marspull -list
falconstryker May 15, 2025
6e84322
updating marspull -list
falconstryker May 15, 2025
33ddb6b
updating marspull -list
falconstryker May 15, 2025
f31b1ce
updating marspull -list
falconstryker May 15, 2025
c4aa5af
updating marspull -list
falconstryker May 16, 2025
1aeb67e
updating marspull -list
falconstryker May 16, 2025
06a3493
updating marspull -list
falconstryker May 16, 2025
3a10f12
updating marspull -list
falconstryker May 16, 2025
684c9fe
updating marspull -list
falconstryker May 16, 2025
986622c
updating marspull -list
falconstryker May 16, 2025
941b586
updating marspull -list
falconstryker May 16, 2025
a7c3de7
updating marspull -list
falconstryker May 16, 2025
6b011f5
updating marspull -list
falconstryker May 16, 2025
771f615
beefing up docstrings
falconstryker May 16, 2025
21d4dec
beefing up docstrings
falconstryker May 16, 2025
c955217
Merge pull request #116 from falconstryker/devel
rurata May 19, 2025
44f028a
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
913cc5d
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
3ff1a24
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
d6ff135
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
d342deb
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
b076497
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
e8192be
updating marspull test to accomodate updated -list option
falconstryker May 19, 2025
0b24c9b
last changes to marspull
falconstryker May 19, 2025
f770d8a
oops
falconstryker May 19, 2025
a68cf59
Merge pull request #117 from falconstryker/devel
rurata May 19, 2025
33e88d9
accepting all devel changes into main
falconstryker May 19, 2025
a9fe7d2
adding ability to do github actions on merge/PR to main as well as devel
falconstryker May 19, 2025
4bbe784
Merge pull request #28 from falconstryker/devel
falconstryker May 19, 2025
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
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
max-line-length = 88
extend-ignore = E203
exclude =
.git,
__pycache__,
build,
dist,
*.egg-info
per-file-ignores =
__init__.py:F401
max-complexity = 10
57 changes: 57 additions & 0 deletions .github/workflows/marscalendar_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: MarsCalendar Test Workflow
# Cancel any in-progress job or previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push to devel branch
push:
branches: [ devel, main ]
paths:
- 'bin/MarsCalendar.py'
- 'tests/test_marscalendar.py'
- '.github/workflows/marscalendar_test.yml'
# Allow manual triggering of the workflow
workflow_dispatch:
# Trigger on pull requests that modify MarsCalendar or tests
pull_request:
branches: [ devel, main ]
paths:
- 'bin/MarsCalendar.py'
- 'tests/test_marscalendar.py'
- '.github/workflows/marscalendar_test.yml'
jobs:
test:
# Run on multiple OS and Python versions for comprehensive testing
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository
- uses: actions/checkout@v3

# Set up the specified Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# Install dependencies
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install numpy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# Install the package in editable mode
- name: Install package
run: pip install -e .

# Run the tests
- name: Run MarsCalendar tests
run: |
cd tests
python -m unittest -v test_marscalendar.py
122 changes: 122 additions & 0 deletions .github/workflows/marsfiles_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: MarsFiles Test Workflow
# Cancel any in-progress job or previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push to devel branch
push:
branches: [ devel, main ]
paths:
- 'bin/MarsFiles.py'
- 'tests/test_marsfiles.py'
- '.github/workflows/marsfiles_test.yml'
- 'amescap/FV3_utils.py'
# Allow manual triggering of the workflow
workflow_dispatch:
# Trigger on pull requests that modify relevant files
pull_request:
branches: [ devel, main ]
paths:
- 'bin/MarsFiles.py'
- 'tests/test_marsfiles.py'
- '.github/workflows/marsfiles_test.yml'
- 'amescap/FV3_utils.py'
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository
- uses: actions/checkout@v3

# Set up the specified Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# Cache pip dependencies
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

# Install dependencies
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install numpy netCDF4 xarray scipy matplotlib
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# Install pyshtools for spatial analysis capabilities
- name: Install pyshtools and spectral dependencies (Ubuntu)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libfftw3-dev
pip install pyshtools

# Install pyshtools for spatial analysis capabilities (macos)
- name: Install pyshtools and spectral dependencies (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
pip install pyshtools

# Install pyshtools for spatial analysis capabilities (Windows)
- name: Install pyshtools and spectral dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
pip install pyshtools

# Install the package with spectral extension
- name: Install package with spectral capabilities
run: |
pip install -e .

# Create a test profile if needed
- name: Create amescap profile
shell: bash
run: |
mkdir -p $HOME
mkdir -p mars_templates
echo "# AmesCAP profile" > mars_templates/amescap_profile
echo "export PYTHONPATH=$PYTHONPATH:$(pwd)" >> mars_templates/amescap_profile
cp mars_templates/amescap_profile $HOME/.amescap_profile
echo "Created profile at $HOME/.amescap_profile"

# Create a patch for the test file to fix Windows path issues
- name: Create test_marsfiles.py path fix for Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$content = Get-Content tests/test_marsfiles.py -Raw
# Fix path handling for Windows
$content = $content -replace "os\.path\.join\(self\.test_dir, file\)", "os.path.normpath(os.path.join(self.test_dir, file))"
Set-Content tests/test_marsfiles.py -Value $content

# Run the tests
- name: Run MarsFiles tests
timeout-minutes: 25
run: |
cd tests
python -m unittest test_marsfiles

# Report file paths if things fail on Windows
- name: Debug Windows paths
if: runner.os == 'Windows' && failure()
shell: pwsh
run: |
Write-Host "Current directory: $(Get-Location)"
Write-Host "Test directory contents: $(Get-ChildItem -Path tests)"
108 changes: 108 additions & 0 deletions .github/workflows/marsformat_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: MarsFormat Test Workflow
# Cancel any in-progress job or previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push to devel branch
push:
branches: [ devel, main ]
paths:
- 'bin/MarsFormat.py'
- 'tests/test_marsformat.py'
- '.github/workflows/marsformat_test.yml'
# Allow manual triggering of the workflow
workflow_dispatch:
# Trigger on pull requests that modify MarsFormat or tests
pull_request:
branches: [ devel, main ]
paths:
- 'bin/MarsFormat.py'
- 'tests/test_marsformat.py'
- '.github/workflows/marsformat_test.yml'
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository
- uses: actions/checkout@v3

# Set up the specified Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# Install dependencies
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install numpy netCDF4 xarray
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# Install the package in editable mode
- name: Install package
run: pip install -e .

# Set HOME for Windows since it might be used by the script
- name: Set HOME environment variable for Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "HOME=$env:USERPROFILE" >> $env:GITHUB_ENV

# Set up AmesCAP configuration - handle platform differences
- name: Set up AmesCAP configuration
shell: bash
run: |
mkdir -p $HOME/.amescap
cp mars_templates/amescap_profile $HOME/.amescap_profile

# Print out environment info
- name: Show environment info
run: |
python -c "import os, sys, numpy, netCDF4, xarray; print(f'Python: {sys.version}, NumPy: {numpy.__version__}, NetCDF4: {netCDF4.__version__}, xarray: {xarray.__version__}')"
echo "Working directory: $(pwd)"
echo "Home directory: $HOME"
echo "Environment variables: $(env)"

# Free up disk space
- name: Free up disk space
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost

# Create temporary directory for tests
- name: Create temporary test directory
shell: bash
run: |
mkdir -p $HOME/marsformat_tests
echo "TMPDIR=$HOME/marsformat_tests" >> $GITHUB_ENV

# Run the integration tests with cleanup between tests
- name: Run MarsFormat tests
run: |
cd tests
python -m unittest -v test_marsformat.py

# Clean up temporary files to avoid disk space issues - OS specific
- name: Clean up temp files (Unix)
if: runner.os != 'Windows' && always()
shell: bash
run: |
rm -rf $HOME/marsformat_tests || true

# Clean up temporary files (Windows)
- name: Clean up temp files (Windows)
if: runner.os == 'Windows' && always()
shell: pwsh
run: |
Remove-Item -Path "$env:USERPROFILE\marsformat_tests" -Recurse -Force -ErrorAction SilentlyContinue
Loading
Loading