Skip to content

Commit

Permalink
Merge branch 'main' into clean-files-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 authored Mar 5, 2024
2 parents f1ff41e + cc20709 commit 5ad7c91
Show file tree
Hide file tree
Showing 153 changed files with 693 additions and 82,516 deletions.
Binary file removed ._.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar.gz filter=lfs diff=lfs merge=lfs -text
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every month
interval: "monthly"
35 changes: 35 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish icesat2waves to PyPI

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist
50 changes: 0 additions & 50 deletions .github/workflows/test-B01_SL_load_single_file.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/test_icesat2_tracks_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Smoke Tests
on:
pull_request: {}
push:
branches: [ main ]
jobs:
python_run_scripts:
strategy:
fail-fast: false
matrix:
version: ['3.11']
runs-on: ubuntu-22.04
steps:
- name: install mpi
run: sudo apt update && sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }} # install the python version needed
cache: "pip"
- name: install icesat2-tracks using pip
run: pip install .
- name: List dependencies
run: pip list
- name: first step B01_SL_load_single_file
run: icesat2waves load-file --track-name 20190502052058_05180312_005_01 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: second step make_spectra
run: icesat2waves make-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: third step plot_spectra
run: icesat2waves plot-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: fouth step IOWAGA threads
run: icesat2waves make-iowaga-threads-prior --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: fifth step B04_angle
run: icesat2waves make-b04-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: sixth step B04_define_angle
run: icesat2waves define-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work
- name: seventh step B06_correct_separate
run: icesat2waves correct-separate --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./work

30 changes: 30 additions & 0 deletions .github/workflows/test_test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Steps
on:
pull_request: {}
push:
branches: [ main ]
jobs:
python_run_scripts:
strategy:
fail-fast: false
matrix:
version: ['3.11']
runs-on: ubuntu-22.04
steps:
- name: install mpi
run: sudo apt update && sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev
- uses: actions/checkout@v3
with:
lfs: true
- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }} # install the python version needed
cache: "pip"
- name: install icesat2-tracks using pip
run: pip install .
- name: install pytest
run: pip install pytest pytest-xdist pytest-sugar pytest-durations
- name: Run tests
run: pytest --capture=sys --verbose --showlocals --tb=long --numprocesses=auto tests/test_steps.py

77 changes: 76 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Prerequisites:
> Windows is not supported for development work – use [WSL](https://learn.microsoft.com/en-us/windows/wsl/) on Windows hosts
Installation:
> [!NOTE]
> For testing purposes this repository uses Git Large File Storage (LFS) to handle large data files. If you want to clone the repository with the LFS files, make sure you have Git LFS installed on your system. You can download it from [here](https://git-lfs.github.com/). After installing, you can clone the repository as usual with `git clone`. Git LFS files will be downloaded automatically. If you've already cloned the repository, you can download the LFS files with `git lfs pull`.

- Clone the repository:
- Navigate to https://github.com/brown-ccv/icesat2-tracks
- Click the "<> Code" button and select a method to clone the repository, then follow the prompts
Expand Down Expand Up @@ -87,7 +91,7 @@ conda env create --name "2021-icesat2-tracks" --file environment.yml
```
... but this has more steps and is thus more likely to fail. Since the installation step takes a long period of time, it is recommended to use the separate commands instead.)

## Conda Configuration
## Conda Configuration (Deprecated)

Conda draws its configuration from multiple places, and will behave differently when the configuration is different, even when using the same `environment.yml` file.

Expand Down Expand Up @@ -201,3 +205,74 @@ unset CONDA_ENVS_PATH
envs_dirs:
- /users/username/anaconda/envs
```
## Command line interface
The `icesat2waves` package comes with a command-line interface (CLI) that facilitates interaction with the package directly from your terminal. This can be particularly useful for scripting and automation. You can access the help documentation for the CLI by running the following command:
```shell
icesat2waves --help
```
As suggested in the help, to run a specific command run `icesat2waves [OPTIONS] COMMAND [ARGS]...`. To view help on running a command, run `icesat2waves COMMAND --help`. For example, to get help about the `load-file` command, you may issue `icesat2waves load-file --help` to get the following output:
```shell
(.venv) $ icesat2waves load-file --help
Usage: icesat2waves load-file [OPTIONS]
Open an ICEsat2 tbeam_stats.pyrack, apply filters and corrections, and
output smoothed photon heights on a regular grid in an .nc file.
Options:
--track-name TEXT [required]
--batch-key TEXT [required]
--id-flag / --no-id-flag [default: id-flag]
--output-dir TEXT [required]
--verbose / --no-verbose [default: no-verbose]
--help Show this message and exit.
```
## Sample workflow
Below is a sample workflow that leverages the included CLI.
1. **Load single file**
```shell
icesat2waves load-file --track-name 20190502052058_05180312_005_01 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
2. **Make spectra from downloaded data**
```shell
icesat2waves make-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
3. **Plot spectra**
```shell
icesat2waves plot-spectra --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
4. **Build IOWAGA priors**
```shell
icesat2waves make-iowaga-threads-prior --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
5. **Build angles**
```shell
icesat2waves make-b04-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
6. **Define and plot angles**
```shell
icesat2waves define-angle --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
7. **Make corrections and separations**
```shell
icesat2waves correct-separate --track-name SH_20190502_05180312 --batch-key SH_testSLsinglefile2 --output-dir ./output
```
6 changes: 0 additions & 6 deletions SlideRule/.ipynb_checkpoints/Untitled-checkpoint.ipynb

This file was deleted.

Loading

0 comments on commit 5ad7c91

Please sign in to comment.