Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
373 commits
Select commit Hold shift + click to select a range
df6a216
changed run_testpackages to use the local pyvenv.sh
lassejsc Oct 31, 2025
2d968c0
changed workflow name
lassejsc Oct 31, 2025
ce29b37
renamed workflow
lassejsc Oct 31, 2025
648ea06
removed sbatch output
lassejsc Oct 31, 2025
897fb94
Removed file accidentally tracked
lassejsc Oct 31, 2025
d8fe9ed
Changed behaviour of fixfigsize and renamed it figsize to fix figsize
lassejsc Oct 31, 2025
16a8049
Merge pull request #357 from lassejsc/image_compare
alhom Oct 31, 2025
8ddbd76
Rename workflow for generating reference data
alhom Oct 31, 2025
c19fc72
Add generate_reference_data_plots.yml workflow
alhom Oct 31, 2025
ef377a0
fixed type
lassejsc Oct 31, 2025
b1e32ed
Get generate_reference_plots from master
alhom Oct 31, 2025
51fc89c
Merge pull request #368 from alhom/image_compare
alhom Oct 31, 2025
d4e0bf8
Update DATAPATH variable in workflow script
alhom Nov 3, 2025
712382d
Update workflow to move module loading for Python
alhom Nov 3, 2025
857d8c7
Log exit code after job completion in script
lassejsc Nov 3, 2025
2baca9d
Update script to use relative paths for Python scripts
lassejsc Nov 3, 2025
b5e7d44
Add exit code logging to test package script
lassejsc Nov 3, 2025
bf4b4cc
Merge pull request #369 from lassejsc/patch-1
alhom Nov 3, 2025
075639f
made compare use latest verification set
lassejsc Nov 3, 2025
28607de
oops comment removed
lassejsc Nov 3, 2025
14063ab
Merge pull request #370 from lassejsc/patch_compare
alhom Nov 3, 2025
d249c08
general create_env fixes
lassejsc Nov 4, 2025
f26b68f
Merge pull request #372 from lassejsc/create_env_fix
alhom Nov 4, 2025
a587a9e
added tests for colormap3dslice (WIP)
lassejsc Nov 4, 2025
7689582
added more tests and changed back the array parameter to higher numbe…
lassejsc Nov 4, 2025
a43b72f
some vectortests
lassejsc Nov 4, 2025
a84cce5
more variable tests?
lassejsc Nov 4, 2025
f52072b
comment reminder
lassejsc Nov 5, 2025
689019e
testpackage changes headache
lassejsc Nov 5, 2025
ce5fb6a
testpackage_colormap restructuring
lassejsc Nov 6, 2025
fe03166
added testpackage_commons , work in progress way of potentially doing…
lassejsc Nov 6, 2025
8cbb9ee
restructuring of testpackage_colormap3dslice based on what was done t…
lassejsc Nov 6, 2025
e82f789
added a way to skip variables 'var' in calls
lassejsc Nov 6, 2025
23ac2fd
More enhancements to the testpackage_commons
lassejsc Nov 7, 2025
bcab7ad
many more additions to the new testpackage sript
lassejsc Nov 7, 2025
da18790
added agnostic calls
lassejsc Nov 10, 2025
52b0d6a
reordering of agnostic calls so they are first
lassejsc Nov 10, 2025
d787618
added isosurface, vdf_profiles, changed it so multile required args work
lassejsc Nov 10, 2025
174b9b0
comment changes
lassejsc Nov 10, 2025
ed3218f
Removed testpackage_colormap3dslice from this PR, can be put into ano…
lassejsc Nov 11, 2025
1e47f65
eof addition also made it so only specific functions can be tested vi…
lassejsc Nov 11, 2025
08e305d
removed testpackage_colormap3dslice batch script
lassejsc Nov 11, 2025
6061d70
Merge branch 'testpackage_expansion' into testpackage_imgae
lassejsc Nov 11, 2025
80f93d2
Implementing the new testpackage script into the new image compare wo…
lassejsc Nov 11, 2025
05d7eef
eof
lassejsc Nov 11, 2025
c167e1c
another eof complain sigh
lassejsc Nov 11, 2025
a2bf026
making things so workflows work and the workflow can skip plots that …
lassejsc Nov 11, 2025
93710a9
removed left debug line from code
lassejsc Nov 11, 2025
ce1b17a
run compare now runs correctly if called without commandline args, wh…
lassejsc Nov 11, 2025
82e7837
clarifying comment
lassejsc Nov 11, 2025
5803652
added bit of a dirty fix for passing multiple argument skips, also ma…
lassejsc Nov 11, 2025
071c723
added more runs and added non v5 multipops
lassejsc Nov 12, 2025
e49b175
finished renaming regularcalls to restartcalls
lassejsc Nov 12, 2025
bdea6f4
added BCQr, testing whether it works
lassejsc Nov 12, 2025
fafb828
more testing with restarts and added missing key to dict
lassejsc Nov 12, 2025
ca0b29f
made restart calls work correctly such that agnostic calls are included
lassejsc Nov 12, 2025
8553141
fixed an amateurish mistake with the lists, they were not extended co…
lassejsc Nov 12, 2025
8340a7c
Added filedir and step as required args
lassejsc Nov 17, 2025
cc4b4ac
Merge remote-tracking branch 'refs/remotes/origin/testpackage_imgae' …
lassejsc Nov 17, 2025
599aefa
filtering out empty args from args_out
lassejsc Nov 17, 2025
9756439
changing into importing the test lists
lassejsc Nov 17, 2025
8405063
added vlasiator5 variable since the custom expressions use that in pl…
lassejsc Nov 17, 2025
b227c50
changed BCQ run parameters
lassejsc Nov 17, 2025
4ee0329
Added template maker, converted plot_colormap to use the commons(may …
lassejsc Nov 17, 2025
a86cf0e
added runs and added uses for call_replace and made it importable fro…
lassejsc Nov 24, 2025
b0c5a5e
added required args back and trying to make it work again
lassejsc Nov 24, 2025
84d9441
fixed required args so it takes into account skipped params
lassejsc Nov 24, 2025
b6b0b02
uncommented runs and fixed argument call things so it now calls work …
lassejsc Nov 24, 2025
77524c6
added nonrestart calls for plot_vdf
lassejsc Nov 24, 2025
b6e13c9
removed normal skip arg for now as it is borked in testpackage_vdf also
lassejsc Nov 24, 2025
7193b36
removed colormap from some calls as they are not incuded in the origi…
lassejsc Nov 24, 2025
5d3d611
fixing vlasiator5 tag and added comment for reminder for later
lassejsc Nov 25, 2025
a6b836c
added normalx to calls with normal so it actually works
lassejsc Nov 25, 2025
7af0253
added exception for ABC for plot_vdf
lassejsc Nov 25, 2025
67ba407
removed pointless delimiter from list
lassejsc Nov 25, 2025
9a773cf
added comment to point out one duplicate call for the future (removin…
lassejsc Nov 26, 2025
bc36ff4
restructured plot_colormap calls
lassejsc Nov 26, 2025
cebf54f
added legacy mode to make the plot output same as the older testpacka…
lassejsc Nov 26, 2025
628e681
fixing things for vdf_profiles
lassejsc Nov 26, 2025
1b36f23
fixing testpackage_plot_ionosphere
lassejsc Nov 26, 2025
ea9f3db
added if statement for the case there are no skipped args
lassejsc Nov 26, 2025
5df1ee2
fixed normal plots and extended v5calls with non v5 calls since they …
lassejsc Nov 26, 2025
38f4fc8
Added FID run and made custom_expressions work differently so less co…
lassejsc Nov 26, 2025
8e64231
moved vlasiator5 custom expression variable setting inside the if sta…
lassejsc Nov 26, 2025
acb8645
fixed so plot_vdfdiff takes vlsvobjs correctly and made filedir passi…
lassejsc Nov 27, 2025
7e0b8ec
cleaned up call_replace and changed so required args work bit differe…
lassejsc Nov 27, 2025
98c1f8e
testpackage vdfdiff changes to make it work
lassejsc Nov 27, 2025
9aa3eac
added vdfdiff exceptions and runs
lassejsc Nov 27, 2025
2a6c82c
took out normal calls as they might not work correctly and fixed non …
lassejsc Nov 27, 2025
d807d31
changed tickinterval calls that took too long
lassejsc Nov 27, 2025
059ba05
added more vdf calls in runs
lassejsc Nov 27, 2025
4c7e6bb
Moved the testpackage definitions to their own folder for the sake of…
lassejsc Dec 1, 2025
c19b7c8
added cv2 image_compare implementation incase ever needed
lassejsc Dec 2, 2025
ffd29a0
added sourcing of CI_env in produce plots
lassejsc Dec 3, 2025
02d76e1
added cluster specifier carrington to sbatch
lassejsc Dec 3, 2025
2c2d113
changed get_diff dictionary to be broader and made it run all tests i…
lassejsc Dec 3, 2025
6f255ad
changed the get_diff to actually now trigger all if 6 or more
lassejsc Dec 3, 2025
8b676fe
added a way to skip certain parameter from all calls in a run
lassejsc Dec 3, 2025
334ae1b
fixed the sbatch parameters so things should now use carrington or uk…
lassejsc Dec 3, 2025
d33516e
accidentally left in a debug line
lassejsc Dec 3, 2025
5f42e41
fixed the python not found error by loading python earlier
lassejsc Dec 3, 2025
eacb76d
changed fetch-depth of checkout so the git diff should work
lassejsc Dec 3, 2025
05dc5d1
still failed, set the fetch-depth to 0, dunno if it slows down too much
lassejsc Dec 3, 2025
516def8
added full test for master and dev pushes and removed push event from…
lassejsc Dec 3, 2025
fe26b8d
added echo for the diffresult in workflow
lassejsc Dec 3, 2025
19ec6c9
fixed folder structure in run_compare
lassejsc Dec 3, 2025
249159e
fixed folder structure(again) in compare.sh
lassejsc Dec 3, 2025
cc84f24
gave the work flow more memory since it seemed to run out on full run
lassejsc Dec 4, 2025
559b8f8
changed the time limit to 45 min and gave more array jobs
lassejsc Dec 4, 2025
974da4c
moved to using cv2 instead of image magick and added opencv-python in…
lassejsc Dec 4, 2025
40138cb
added numpy import to testpackage_compare.py
lassejsc Dec 4, 2025
f1dfb92
gave workflows 120 minutes to complete as 60 is not enough for full c…
lassejsc Dec 4, 2025
48cc33f
added warning for new files produced
lassejsc Dec 4, 2025
636f119
Merge branch 'master' into testpackage_imgae
lassejsc Dec 5, 2025
de9881a
made editable default in create_env and made it use [all] since testp…
lassejsc Dec 5, 2025
ce6adfe
changed how outputdir calls are made since how it works has changed
lassejsc Dec 8, 2025
5e5cce8
skipped args to FHA runs for expressions
lassejsc Dec 8, 2025
992a161
parallelizing compare
lassejsc Dec 8, 2025
1270b8b
removed the legacy mode as too many things have changed to make it wo…
lassejsc Dec 8, 2025
ed3a774
Merge remote-tracking branch 'refs/remotes/downstream/testpackage_img…
lassejsc Dec 8, 2025
4688d9f
Merge remote-tracking branch 'refs/remotes/downstream/testpackage_img…
lassejsc Dec 8, 2025
7468db9
removed vdf_profiles from FHA
lassejsc Dec 8, 2025
3e416f2
Merge remote-tracking branch 'origin' into testpackage_imgae
lassejsc Dec 8, 2025
6dd9104
more arrays to the testpackage
lassejsc Dec 8, 2025
1cb3693
fixed compare not using sbatch
lassejsc Dec 8, 2025
b18d7a0
removed unused imagemagick module
lassejsc Dec 8, 2025
a4626b8
added ci_env source, module load for libgl which is dependancy for cv…
lassejsc Dec 8, 2025
8507ffb
added wait for the sbatch, otherwise things don't work
lassejsc Dec 9, 2025
1031038
cleaned up the modules in the sbatch scripts
lassejsc Dec 9, 2025
0f5fac1
nevermind previous commit borke it :-D added module load python and s…
lassejsc Dec 9, 2025
ee7abf7
cleaned up compare batch script and added the get_job_error to compar…
lassejsc Dec 9, 2025
59fa03e
added skip for nooverwrite since that will always produce error since…
lassejsc Dec 9, 2025
187a28e
fixed full workflow "with:"
lassejsc Dec 9, 2025
e89d873
changed to kappa for verf_set location
lassejsc Dec 10, 2025
1af6e77
found a faster way to compare the images, though no RMSE, this should…
lassejsc Dec 10, 2025
0d20790
changed the datalocation to wrk-kappa in testpackage
lassejsc Dec 10, 2025
9729712
added a type check in call_replace and removed custom expression call…
lassejsc Dec 10, 2025
fe87b17
added timeout 5 minutes for uv and dependencies installation steps fo…
lassejsc Dec 10, 2025
836f1f8
more workflow timeouts, this time for actions/checkout step
lassejsc Dec 10, 2025
25d0f49
changed so generate workflow goes to kappa
lassejsc Dec 10, 2025
28a6d72
Merge pull request #378 from lassejsc/testpackage_imgae
alhom Dec 11, 2025
d52f505
Removed weekly run from the test that uses git diff
lassejsc Dec 11, 2025
b6a1231
Changed the workflow names to be more accurate
lassejsc Dec 11, 2025
684cf44
Merge pull request #391 from lassejsc/renaming_workflows
lassejsc Dec 11, 2025
07fda72
removed expression calls from 3dslice
lassejsc Dec 11, 2025
a4efd14
Merge remote-tracking branch 'origin/image_compare' into clean_up_com…
lassejsc Dec 11, 2025
934469c
manual git shenanigans on last commit
lassejsc Dec 11, 2025
b3a86fe
sbatch accidentally twice because of git merge shenanigans
lassejsc Dec 11, 2025
7d43db0
Reduce log spam
lassejsc Dec 11, 2025
2e6d78b
Merge pull request #395 from lassejsc/image_compare_reduce_log_spam
alhom Dec 11, 2025
b3e6f79
Modified the vmax/vmin values of ionosphere testpackage plots since they
lassejsc Dec 11, 2025
b70d3d4
Removed the now outdated testpackage scripts
lassejsc Dec 11, 2025
3c18b31
Cleaned up comments in template_maker
lassejsc Dec 11, 2025
a52ebfa
Removed the old batch scripts also
lassejsc Dec 11, 2025
7e174e5
Removed the unused ImageMagick from create_env
lassejsc Dec 11, 2025
1efa343
Should fix the linter complaining
lassejsc Dec 11, 2025
ec3d2b4
Added references to custom_expr.py so linter maybe doesnt complain?
lassejsc Dec 11, 2025
c48dfe5
fixed figsize fixing
lassejsc Dec 12, 2025
3f43cb1
fixed typo
lassejsc Dec 12, 2025
a1cb5ed
Another typo, (learning vim is hard)
lassejsc Dec 12, 2025
0a2586f
Added savefig_pad since it was not assignet if figsize was set
lassejsc Dec 12, 2025
fddbaaa
changed diff to image_compare and changed install dependencies timeou…
lassejsc Dec 12, 2025
a92267a
Merge pull request #398 from lassejsc/fixfigsize_again
alhom Dec 12, 2025
808bcbe
Merge pull request #396 from lassejsc/lint_fix
alhom Dec 12, 2025
6fe94ec
Merge remote-tracking branch 'upstream/image_compare' into clean_up_c…
lassejsc Dec 15, 2025
41197e4
General clean up, removing unused imports and changing syntax to be b…
lassejsc Dec 15, 2025
e89588a
Added warning if testpackage changes
lassejsc Dec 15, 2025
1fa31a2
ditto earlier commit
lassejsc Dec 15, 2025
94fa06e
Added constraint to gen.._verfset script
lassejsc Dec 15, 2025
8153096
Merge pull request #399 from lassejsc/constraint_verf_set
lassejsc Dec 15, 2025
4f64c99
Added :: so maybe github recognizes the warning now
lassejsc Dec 15, 2025
6b5a356
Maybe it finally recognizes?
lassejsc Dec 15, 2025
564814c
Why is git being like this, maybe htis time the file changed finally
lassejsc Dec 15, 2025
3d65143
Fixed run_compare not taking pass correctly
lassejsc Dec 15, 2025
7de777c
Merge pull request #401 from lassejsc/pass_fix
lassejsc Dec 15, 2025
6ffe5b4
Added latex :)
lassejsc Dec 15, 2025
d51e084
Merge pull request #402 from lassejsc/generate_verf_set_fixing
lassejsc Dec 15, 2025
dc1d0d8
Cleaned up imports from commons.py and added exception Exception sinc…
lassejsc Dec 15, 2025
8467815
Better exception handling and warning for testpackage_commons
lassejsc Dec 15, 2025
79b24b7
Formatting changes for commons
lassejsc Dec 15, 2025
8e7f965
slight restructuring adjustments
lassejsc Dec 15, 2025
24cbd3a
Removed the warning from exec call_list since it's misleading in a log
lassejsc Dec 15, 2025
e86d167
Added clarifying comment to import call
lassejsc Dec 15, 2025
0cf0711
commented experssion call from template maker out
lassejsc Dec 16, 2025
8f85165
Merge pull request #394 from lassejsc/clean_up_compare
alhom Dec 17, 2025
2c0adaf
Merge branch 'image_compare' into testpackage_warnings
lassejsc Dec 17, 2025
ab43313
Added clarifying prints
lassejsc Dec 17, 2025
d9003cf
Merge pull request #400 from lassejsc/testpackage_warnings
lassejsc Dec 17, 2025
e07638d
added lockfile so compare doesnt compare incomplete verfset
lassejsc Dec 17, 2025
f5bf034
Better wording on print
lassejsc Dec 17, 2025
1837a9d
better lockfile failing
lassejsc Dec 17, 2025
88024d1
Fix exit code syntax in workflow script
lassejsc Dec 17, 2025
e48033d
Fix exit status syntax in run_compare.sh
lassejsc Dec 17, 2025
ace1aa5
fixed exit syntax in full workflow
lassejsc Dec 17, 2025
9b1a90a
Ensure lockfile is created after DATAPATH directory
lassejsc Dec 17, 2025
8a4944c
Merge pull request #403 from lassejsc/testpackage_lock_and_setprint
lassejsc Dec 17, 2025
695f00c
Added hostname to run_compare.sh
lassejsc Dec 17, 2025
b0bf075
Added more verbose printing upon finding .lockfile, edited the workfl…
lassejsc Dec 17, 2025
0526648
Merge branch 'master' into image_compare
lassejsc Dec 17, 2025
b881c85
Revise workflow description for clarity
lassejsc Dec 17, 2025
8def1f3
Removed useless concurrency that was based on pullrequests
lassejsc Dec 17, 2025
ea6d5e0
updated plot_vdfdiff if statement, variable changed to correct one
lassejsc Dec 17, 2025
2b4bdaf
removed old comments from run_testpackage_workflow.sh
lassejsc Dec 17, 2025
fdb734f
Removed old comments and added little comments to testpackage_commons.py
lassejsc Dec 17, 2025
28d5093
Multiline comment broke the template maker, removed that and added fi…
lassejsc Dec 17, 2025
f74c3b4
Added figsize to required args for good measure as that is needed for…
lassejsc Dec 17, 2025
0006b10
Removed manualcall from the run dictionaries as that was leftover fro…
lassejsc Dec 17, 2025
c980fbe
Added cb_horizontal to plot calls where it is and added AMR plotting …
lassejsc Dec 17, 2025
40ce31f
Moved the call_replace and system_call to testpackage_helpers.py for …
lassejsc Dec 17, 2025
ac8e368
added if statement incase diff_log is not made (could be the case)
lassejsc Dec 17, 2025
05cd142
Added so the branch to compare to changes on based whether pullreques…
lassejsc Dec 17, 2025
d6941f2
For whatever reason this was not added on the last commit, thank you git
lassejsc Dec 17, 2025
61f6539
Bash syntax issues (skill issue)
lassejsc Dec 17, 2025
66871aa
Changed the AMR call so it would work, it now takes lists, this issue…
lassejsc Dec 17, 2025
3fff0d2
Change logging file mode to write in order to try to fix warnings
lassejsc Dec 17, 2025
0793e50
Removed logging in favor of just using open()
lassejsc Dec 17, 2025
3b40354
Fixed cb_horizontal typo in testpackage definitions
lassejsc Dec 18, 2025
83a85bb
fixed a typo in testpackage_plot_vdfdiff.py
lassejsc Dec 18, 2025
b46be53
made it so the exception raised with nooverwrite call doesn't call it…
lassejsc Dec 18, 2025
db27fa9
Removed unused import and moved analysator import in testpackage_help…
lassejsc Dec 18, 2025
359672d
General comment cleanup and clarifications
lassejsc Dec 18, 2025
6b882f4
added ::error: to the failure calls in testpackage_commons.py so they…
lassejsc Dec 18, 2025
e169df3
changed to # comment from ''' since it's more reliable
lassejsc Dec 18, 2025
7660d65
minor comment changes
lassejsc Dec 18, 2025
40d4a0f
added so if on HILE the create_env pyvenv script uses cray-python
lassejsc Dec 18, 2025
e5d0bdd
sigh, missing newline from previous commit
lassejsc Dec 18, 2025
54adff4
Merge remote-tracking branch 'upstream/master' into image_compare
lassejsc Dec 19, 2025
b99a426
Added 'limitedsize=True' calls to colormap non-restarting calls
lassejsc Dec 19, 2025
b4012ed
New indexing system
lassejsc Dec 19, 2025
fa60f1f
More memory for sbatch job
lassejsc Dec 19, 2025
00603a3
variable naming error in the indexing fixed
lassejsc Dec 19, 2025
696e98e
Debug line left in, removed
lassejsc Dec 19, 2025
3dcc2e2
Added testpackage dependancy group for image_compare/testpackage to use
lassejsc Dec 19, 2025
4173f4a
added analysator[vtk] to tesstpackage dep. group
lassejsc Dec 19, 2025
9a16c5c
Added new workflow to test oldest python version
lassejsc Dec 19, 2025
ac28faf
Python version checking and trying for old python workflow
lassejsc Dec 19, 2025
79371cf
missing file extension from cat in the new workflow
lassejsc Dec 19, 2025
d213c5d
missing dollars
lassejsc Dec 19, 2025
65028eb
added another if so the version does not jump after successful match
lassejsc Dec 19, 2025
f3a787c
testing to see if removing module load works from the run_testpackage…
lassejsc Dec 19, 2025
b7426ed
module list in the testpackage_oldest_pytohn workflow for debugging
lassejsc Dec 19, 2025
6e75ba4
forcing python version 3.7 in the oldest_python.yml to debug workflow
lassejsc Dec 19, 2025
6e72b6b
ditto previous commit except right spot for it§
lassejsc Dec 19, 2025
3d7fa81
testing whether this will make the older python version work
lassejsc Dec 19, 2025
5f90d26
Revert "testing whether this will make the older python version work"
lassejsc Dec 19, 2025
80d4ea4
added back the module load Python into run_testpackage_workflow
lassejsc Dec 19, 2025
e2f0cb6
Added echoing of the loaded module and module purge at start of pytho…
lassejsc Jan 5, 2026
8aceb0d
Merge pull request #405 from lassejsc/indexing_change
lassejsc Jan 5, 2026
ffe45cc
Added better error output for image comparison script
lassejsc Jan 5, 2026
f90db86
Merge branch 'master' into image_compare
lassejsc Jan 7, 2026
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
7 changes: 3 additions & 4 deletions .github/workflows/generate_reference_plots.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

# This workflow will install Python dependencies , analysator and generate verification set to /wrk-kappa/group/spacephysics/analysator/CI/verification_sets/ under new folder based on commit id
name: generate_reference_data

on:
Expand Down Expand Up @@ -43,9 +41,10 @@ jobs:

DATAPATH="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets/$(git rev-parse HEAD)"
mkdir $DATAPATH
touch $DATAPATH/.lockfile
sbatch -W -o testpackage_gen_verf.txt --job-name gen_verf_plots ./testpackage/run_testpackage_generate_verf_set.sh $DATAPATH


cat testpackage_gen_verf.txt

python ./testpackage/testpackage_get_job_error.py testpackage_gen_verf.txt
rm $DATAPATH/.lockfile
31 changes: 27 additions & 4 deletions .github/workflows/test_compare_image_oldest_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,38 @@ jobs:
- name: Get oldest allowed python version from pyproject.toml
id: pyversion
run: |
echo "PYTHON=$(cat pyproject | grep -Po '^requires-python\W*=\W*".+\K\d.+\d')" >> $GITHUB_OUTPUT
module purge
PYTHON=$(cat pyproject.toml | grep -Po '^requires-python\W*=\W*".+\K\d.+\d')
#PYTHON="3.7"
MAJOR=$(echo $PYTHON | grep -Po '^\d+')
MINOR=$(echo $PYTHON | grep -Po '\.\K\d+([\.]|$)')
AVAILABLE_VERSIONS=$(module spider Python)
N=0
while [[ ! $VERSIONS_MATCH ]]
do
echo "Trying to find module for Python/$PYTHON"
VERSIONS_MATCH=$(echo $AVAILABLE_VERSIONS | grep -Po 'Python/.+?-' | grep -Po 'Python'/$PYTHON)
if [[ ! $VERSIONS_MATCH ]]; then
MINOR=$(( $MINOR + 1 ))
PYTHON=$MAJOR.$MINOR
N=$(( N + 1))
if (( N> 20 )); then
echo "::error:: Could not find a python version to use."
exit 1
fi
fi
done
echo "PYTHON=$PYTHON" >> $GITHUB_OUTPUT
module load Python/$PYTHON
module list Python
- name: Install dependencies
timeout-minutes: 5
run: |
export TMPDIR=$RUNNER_TEMP
export UV_LINK_MODE=copy
module purge
module load Python/{{ steps.pyversion.outputs.PYTHON }}
module load Python/${{ steps.pyversion.outputs.PYTHON }}
module list
uv venv CI_env
. CI_env/bin/activate
uv pip install --editable ../analysator[${{ matrix.extras }}]
Expand All @@ -43,7 +66,7 @@ jobs:
run: |
export TMPDIR=$RUNNER_TEMP
module purge
module load Python/{{ steps.pyversion.outputs.PYTHON }}
module load Python/${{ steps.pyversion.outputs.PYTHON }}
verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets"
verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')
if [[ -f $verf_loc/$verfset/.lockfile ]]; then
Expand All @@ -59,7 +82,7 @@ jobs:
- name: Comparing plotted data
run: |
export TMPDIR=$RUNNER_TEMP
module load Python/{{ steps.pyversion.outputs.PYTHON }}
module load Python/${{ steps.pyversion.outputs.PYTHON }}
. CI_env/bin/activate
sbatch -W -o "testpackage_compare.txt" ./testpackage/run_compare.sh
cat testpackage_compare.txt
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/test_compare_images.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

# This workflow will install Python dependencies and analysator, run the analysator testpackage based on git diff and compare the images
name: Turso compare selectively images

on:
pull_request:
branches: [ master, dev]
workflow_dispatch:

concurrency:
Expand All @@ -21,7 +21,7 @@ jobs:
fail-fast: false
max-parallel: 2
matrix:
extras: ["all"]
extras: ["testpackage"]
steps:
- uses: actions/checkout@v4
timeout-minutes: 5
Expand All @@ -46,10 +46,18 @@ jobs:
export TMPDIR=$RUNNER_TEMP
module purge
module load Python/3.10.4-GCCcore-11.3.0

export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py)
verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets"
verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')
if [[ -f $verf_loc/$verfset/.lockfile ]]; then
echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation."
exit 1
fi
export DIFFRESULT=$(python ./testpackage/testpackage_get_diff.py ${{ github.base_ref }})
if [[ -f diff_log.txt ]]; then
cat diff_log.txt
fi
echo "DIFFRESULT=$DIFFRESULT" >> $GITHUB_OUTPUT
echo "$DIFFRESULT"
echo "Running $DIFFRESULT"
sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh $DIFFRESULT

cat testpackage_run.txt
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/test_compare_images_full.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
#This workflow will install python and run the full analysator testpackage with image comparison for the results

name: Turso compare all images

on:
push:
branches: [ master, dev]
schedule:
- cron: '0 8 * * MON'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}


jobs:

Expand All @@ -21,7 +20,7 @@ jobs:
fail-fast: false
max-parallel: 2
matrix:
extras: ["all"]
extras: ["testpackage"]
steps:
- uses: actions/checkout@v4
timeout-minutes: 5
Expand All @@ -44,7 +43,12 @@ jobs:
export TMPDIR=$RUNNER_TEMP
module purge
module load Python/3.10.4-GCCcore-11.3.0

verf_loc="/wrk-kappa/group/spacephysics/analysator/CI/verification_sets"
verfset=$(ls -lth $verf_loc | grep ^d | head -n1 | grep -Po '\w+$')
if [[ -f $verf_loc/$verfset/.lockfile ]]; then
echo -e ".lockfile found in $verf_loc/$verfset, not running test, as the verification set generation is likely still ongoing\n Check ongoing actions and/or re-run verification set generation."
exit 1
fi
sbatch -W -o testpackage_run.txt --job-name gen_plots ./testpackage/run_testpackage_workflow.sh

cat testpackage_run.txt
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_python_turso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ jobs:
extras: ["none", "all", "bvtk"]
steps:
- uses: actions/checkout@v4
timeout-minutes: 5
- name: Install uv
uses: astral-sh/setup-uv@v6
timeout-minutes: 5
- name: Install dependencies
timeout-minutes: 5
run: |
export TMPDIR=$RUNNER_TEMP
uv venv CI_env
Expand Down
22 changes: 15 additions & 7 deletions analysator/pyPlots/plot_vdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def plot_vdf(filename=None,
biglabel=None, biglabloc=None,
noxlabels=None, noylabels=None,
axes=None, cbaxes=None, cb_horizontal=False,
contours=None
contours=None,figsize=None
):

''' Plots a coloured 2D plot of a VDF (a slice of given thickness or fully projected) with axes and a colour bar.
Expand Down Expand Up @@ -521,7 +521,7 @@ def plot_vdf(filename=None,
:kword scale_cb: Colour bar text additional scale factor (default=5.0)
:kword scale_label: Big label text additional scale factor (default=12.0)
:kword thick: line and axis thickness, default=1.0

:kword figsize: Set figure size, default=None which will use [4.0,3.15*ratio]

:returns: Outputs an image to a file or to the screen.

Expand Down Expand Up @@ -1080,15 +1080,21 @@ def plot_vdf(filename=None,
# Define figure size
ratio = (yvalsrange[1]-yvalsrange[0])/(xvalsrange[1]-xvalsrange[0])
# default for square figure is figsize=[4.0,3.15]
figsize = [4.0,3.15*ratio]

# Plot the slice
[XmeshXY,YmeshXY] = np.meshgrid(edgesX/velUnit,edgesY/velUnit) # Generates the mesh to map the data to

if axes is None:
# Create 300 dpi image of suitable size
fig = plt.figure(figsize=figsize,dpi=300)
if figsize is not None:

if noborder:
logging.warning("noborder and figsize enabled, this may undo effects of figsize")
fig = plt.figure(figsize=figsize,dpi=300)
else:
# Create 300 dpi image of suitable size
fig = plt.figure(figsize=[4.0,3.15*ratio] ,dpi=300)
ax1 = plt.gca() # get current axes

else:
ax1=axes
fig1 = ax1.pcolormesh(XmeshXY,YmeshXY,binsXY, cmap=colormap,norm=norm)
Expand Down Expand Up @@ -1176,8 +1182,7 @@ def plot_vdf(filename=None,
elif biglabloc==3:
BLcoords=[0.02,0.02]
BLha = "left"
BLva = "bottom"

BLva = "bottom"
plt.text(BLcoords[0],BLcoords[1],biglabel, fontsize=fontsize4,weight='black', transform=ax1.transAxes, ha=BLha, va=BLva,color='k',bbox=dict(facecolor='white', alpha=0.5, edgecolor=None))


Expand Down Expand Up @@ -1295,6 +1300,9 @@ def plot_vdf(filename=None,
plt.tight_layout()
savefig_pad=0.05 # The default is 0.1
bbox_inches=None
elif figsize is not None:
savefig_pad=0.05
bbox_inches=None
else:
plt.tight_layout(pad=0.01)
savefig_pad=0.01
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ all = [
bvtk = [
"vtk==9.2.6",
]

testpackage = [
"opencv-python",
"analysator[vtk]",
]
[project.urls]
Homepage = "https://github.com/fmihpc/analysator"
Issues = "https://github.com/fmihpc/analysator/issues"
Expand Down
90 changes: 90 additions & 0 deletions testpackage/create_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import os
import venv
from testpackage_helpers import system_call
from sys import version_info as python_version_info
from sys import version as python_version
import argparse

def create_venv(path,install_analysator=True,editable=False):
virt_env= venv.EnvBuilder(with_pip=True,upgrade_deps=True)
context=virt_env.ensure_directories(path)
virt_env.create(path)
virt_env.setup_python(context)

#Does not work in python versions <3.13
if python_version_info.major>=3 and python_version_info.minor>=13:
virt_env.create_git_ignore_file(context)

virt_env.create_configuration(context)
virt_env.setup_scripts(context)
virt_env.post_setup(context)
if install_analysator:
editable='--editable' if editable else None
system_call(f'{path}/bin/pip install {editable} ../[testpackage]',live_output=True)
print(f'Virtual environment created at {path}')
return None


def create_venv_script(path,venv_path):
if path[-1]!="/":
path=path+"/"

if not os.path.isdir(path):
raise FileNotFoundError(f"{path} does not exist.")

if os.path.isfile(path+"pyvenv.sh"):
#If file exists, check for source line and add one if not present
with open(path+"pyvenv.sh","a+") as f:
f.seek(0)
for line in f:
if "source" in line[:6]:
raise SystemError("source line already in pyvenv.sh!")

f.write(f"source {venv_path}/bin/activate\n")
f.close()
else:
#Create the file with the source line
with open(path+"pyvenv.sh","w") as f:
f.write("module purge\n")
if 'TURSO' in os.uname().nodename.upper():
f.write("export PATH=/wrk-vakka/group/spacephysics/proj/appl/tex-basic/texlive/2023/bin/x86_64-linux:$PATH\n")

#Get used python version and gcc version
#note that this may break if the version string format changes
#Module load of python is required, otherwise python cannot be called outside the directory the venv is in (if the module system is used)
version_info = python_version.split(" ")
used_python_version = version_info[0]
used_gcc_version = version_info[-1].strip("[]")

#If module system is used, on HILE use cray-python!
if 'HILE' in os.uname().nodename.upper():
f.write("module load cray-python\n")
else:
f.write(f"module load Python/{used_python_version}-GCCcore-{used_gcc_version}\n")
f.write("module list\n")
f.write(f"source {venv_path}/bin/activate\n")

f.close()


if __name__ == "__main__":
#Will install python venv with same version as the python this script was called with

create_venv_local = True #Create a virtual environment in the current folder (should be in testpackage folder)

parser=argparse.ArgumentParser(description='Create python virtual environment for testpackage, will also create batch script that can be sourced.')
parser.add_argument('--no-analysator',action='store_true',help='Do not install analysator.',default=False)
parser.add_argument('--editable','-e',action='store_true',help='Install analysator as editable',default=True)
args=parser.parse_args()

venv_name= 'venv_testpackage'
venv_path = os.path.abspath('./'+venv_name)
if venv_name not in os.listdir('.') and create_venv_local:
print('venv_testpackage not found, creating virtual environment')
create_venv(venv_path,editable=args.editable,install_analysator=not args.no_analysator)
create_venv_script('./',venv_path)
else:
print('venv_testpackage found, not creating virtual environment')



Loading
Loading