Skip to content

Commit

Permalink
Merge pull request #88 from brown-ccv/87-cli-step-1-b01_sl_load_singl…
Browse files Browse the repository at this point in the history
…e_filepy

CLI Tools, CLI for Steps 1-7
  • Loading branch information
cpaniaguam authored Feb 17, 2024
2 parents 5c60a90 + f3c28c7 commit bc3d591
Show file tree
Hide file tree
Showing 13 changed files with 4,080 additions and 3,289 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/test-B01_SL_load_single_file.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test B01_SL_load_single_file
name: Test Steps
on:
pull_request: {}
push:
Expand All @@ -23,18 +23,28 @@ jobs:
run: pip install .
- name: List dependencies
run: pip list
- name: test icesat2waves app
run: |
icesat2waves --help
icesat2waves load-file --help
icesat2waves make-spectra --help
icesat2waves plot-spectra --help
icesat2waves make-iowaga-threads-prior --help
icesat2waves make-b04-angle --help # prelim name
icesat2waves define-angle --help
icesat2waves correct-separate --help # prelim name
- name: first step B01_SL_load_single_file
run: python src/icesat2_tracks/analysis_db/B01_SL_load_single_file.py 20190502052058_05180312_005_01 SH_testSLsinglefile2 True
run: load-file --track-name 20190502052058_05180312_005_01 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: second step make_spectra
run: python src/icesat2_tracks/analysis_db/B02_make_spectra_gFT.py SH_20190502_05180312 SH_testSLsinglefile2 True
run: make-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: third step plot_spectra
run: python src/icesat2_tracks/analysis_db/B03_plot_spectra_ov.py SH_20190502_05180312 SH_testSLsinglefile2 True
- name: fourth step IOWAGA thredds
run: python src/icesat2_tracks/analysis_db/A02c_IOWAGA_thredds_prior.py SH_20190502_05180312 SH_testSLsinglefile2 True
- name: Fifth step B04_angle
run: python src/icesat2_tracks/analysis_db/B04_angle.py SH_20190502_05180312 SH_testSLsinglefile2 True
- name: Sixth step B05_define_angle
run: python src/icesat2_tracks/analysis_db/B05_define_angle.py SH_20190502_05180312 SH_testSLsinglefile2 True
- name: Seventh step B06_correct_separate_var
run: python src/icesat2_tracks/analysis_db/B06_correct_separate_var.py SH_20190502_05180312 SH_testSLsinglefile2 True

run: plot-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: fouth step IOWAGA threads
run: make-iowaga-threads-prior --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: fifth step B04_angle
run: make-b04-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: sixth step B04_define_angle
run: define-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: seventh step B06_correct_separate
run: correct-separate --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ analysis_db/support_files/
*.egg-info/
.installed.cfg
*.egg

logs/
*__pycache__/
*__pycache__/*

# Environments
.env
.venv
.venv39/
env/
venv/
ENV/
Expand All @@ -57,4 +58,4 @@ dist/

#visual code
.vscode/
*.h5
*.h5
25 changes: 22 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ dependencies = [ # Optional
"emcee >=3.1.4, <4.0.0",
"netCDF4 >=1.6.5, <2.0.0",
"siphon >=0.9, <1.0.0",
"h5py >=3.5.0, < 4.0.0"
"h5py >=3.5.0, < 4.0.0",
"termcolor >=2.4.0, < 3.0.0",
"typer >=0.9.0, < 1.0.0",
]

# List additional groups of dependencies here (e.g. development
Expand All @@ -132,8 +134,16 @@ dependencies = [ # Optional
# Similar to `dependencies` above, these must be valid existing
# projects.
[project.optional-dependencies] # Optional
dev = ["check-manifest","black","icesat2-tracks[test]"]
test = ["coverage"]
dev = [
"check-manifest",
"black",
"icesat2-tracks[test]"
]
test = [
"coverage",
"pytest >=7.4.4, <8.0.0",
"pytest-xdist >=3.5.0, <4.0.0"
]

# List URLs that are relevant to your project
#
Expand All @@ -155,6 +165,15 @@ test = ["coverage"]
[project.scripts] # Optional
#TODO: ADD ANY SCRIPTS WE WANT TO HAVE
download = "icesat2_tracks.icesat2_tools_scripts.nsidc_icesat2_associated2:main"
load-file = "icesat2_tracks.analysis_db.B01_SL_load_single_file:load_file_app"
make-spectra = "icesat2_tracks.analysis_db.B02_make_spectra_gFT:make_spectra_app"
plot-spectra = "icesat2_tracks.analysis_db.B03_plot_spectra_ov:plot_spectra"
make-iowaga-threads-prior = "icesat2_tracks.analysis_db.A02c_IOWAGA_thredds_prior:make_iowaga_threads_prior_app"
make-b04-angle = "icesat2_tracks.analysis_db.B04_angle:make_b04_angle_app"
define-angle = "icesat2_tracks.analysis_db.B05_define_angle:define_angle_app"
correct-separate = "icesat2_tracks.analysis_db.B06_correct_separate_var:correct_separate_app"
icesat2waves = "icesat2_tracks.app:app"


# This is configuration specific to the `setuptools` build backend.
# If you are using a different build backend, you will need to change this.
Expand Down
13 changes: 8 additions & 5 deletions src/icesat2_tracks/ICEsat2_SI_tools/iotools.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def init_from_input(arguments):
batch_key = arguments[2]
# $(hemisphere) $(coords) $(config)

print("read vars from file: " + str(arguments[1]))
# print("read vars from file: " + str(arguments[1]))

if len(arguments) >= 4:
if arguments[3] == "True":
Expand All @@ -49,13 +49,16 @@ def init_from_input(arguments):
else:
test_flag = arguments[3]

print("test_flag found, test_flag= " + str(test_flag))
# print("test_flag found, test_flag= " + str(test_flag))
else:
test_flag = False
print(track_name)

print("----- batch =" + batch_key)
print("----- test_flag: " + str(test_flag))
# TODO: print statements to be handled with logger
# # print(track_name)

# print("----- batch =" + batch_key)
# print("----- test_flag: " + str(test_flag))

return track_name, batch_key, test_flag


Expand Down
Loading

0 comments on commit bc3d591

Please sign in to comment.