Skip to content

Commit

Permalink
Merge pull request #45 from AdamTheisen/docs
Browse files Browse the repository at this point in the history
ENH: Updating document build workflow
  • Loading branch information
AdamTheisen authored Aug 16, 2023
2 parents 442a5b8 + 90a251d commit 7c90dcd
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy
name: Documentation

on:
push:
Expand All @@ -25,6 +25,7 @@ jobs:
run: |
sudo apt-get update
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip3 install wheel
pip3 install setuptools
pip3 install --upgrade cython numpy pyshp six
Expand All @@ -36,15 +37,14 @@ jobs:
pip3 install sphinx-rtd-theme
pip3 install sphinx-gallery
pip3 install sphinx-copybutton
pip3 install pyproj
pip3 install -r requirements.txt
#pip3 install pyproj
sudo python3 setup.py install
cd docs
make html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.7.1
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
2 changes: 1 addition & 1 deletion continuous_integration/environment_actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Basic environment for ACT.
# Basic environment for RadTraQ.
name: radtraq_env
channels:
- conda-forge
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_cfad.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import matplotlib.pyplot as plt

# Read in example data
obj = read_netcdf(radtraq.tests.sample_files.EXAMPLE_KAZR)
ds = read_netcdf(radtraq.tests.sample_files.EXAMPLE_KAZR)

# Calculate CFAD histogram
data_array = radtraq.plotting.cfad.calc_cfad(obj, 'reflectivity_copol')
data_array = radtraq.plotting.cfad.calc_cfad(ds, 'reflectivity_copol')

# Plot CFAD histogram
dims = data_array.dims
Expand Down
12 changes: 6 additions & 6 deletions examples/plot_cloud_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
import matplotlib.pyplot as plt

# Read in sample data using ACT
obj = act.io.armfiles.read_netcdf(radtraq.tests.sample_files.EXAMPLE_KAZR)
ds = act.io.armfiles.read_netcdf(radtraq.tests.sample_files.EXAMPLE_KAZR)

# Resample data for ease of processing
obj = obj.resample(time='1min').nearest()
ds = ds.resample(time='1min').nearest()

# Calculate and apply cloud mask
obj = radtraq.proc.cloud_mask.calc_cloud_mask(obj, 'reflectivity_copol')
obj = obj.where(obj['cloud_mask_2'] == 1)
ds = radtraq.proc.cloud_mask.calc_cloud_mask(ds, 'reflectivity_copol')
ds = ds.where(ds['cloud_mask_2'] == 1)

# Plot data using ACT
display = act.plotting.TimeSeriesDisplay(obj)
display = act.plotting.TimeSeriesDisplay(ds)
display.plot('reflectivity_copol', cmap='jet')
display.axes[0].set_ylim([0, 20000])
plt.show()

obj.close()
ds.close()
6 changes: 3 additions & 3 deletions examples/plot_corner_reflector_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import matplotlib.pyplot as plt

# Read in sample data using ACT
obj = read_netcdf(radtraq.tests.sample_files.EXAMPLE_RASTER)
ds = read_netcdf(radtraq.tests.sample_files.EXAMPLE_RASTER)

# Process and plot raster file
data = radtraq.plotting.corner_reflector.plot_cr_raster(obj, target_range=478.,
data = radtraq.plotting.corner_reflector.plot_cr_raster(ds, target_range=478.,
el_limits=[-0.5, 2.5], noplot=False)
plt.show()
obj.close()
ds.close()
4 changes: 2 additions & 2 deletions examples/plot_self_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import matplotlib.pyplot as plt

# Read in example data
obj = read_netcdf(radtraq.tests.sample_files.EXAMPLE_CSAPR)
ds = read_netcdf(radtraq.tests.sample_files.EXAMPLE_CSAPR)

# Set thresholds of RhoHv > 0.99
thresh = {'copol_correlation_coeff': 0.99}
Expand All @@ -23,5 +23,5 @@
'mean_doppler_velocity': {'variable': 'reflectivity', 'bin_width': [1, 0.5]}}

# Call RadTraQ function
display = radtraq.plotting.plot_self_consistency(obj, variables=var_dict, thresh=thresh)
display = radtraq.plotting.plot_self_consistency(ds, variables=var_dict, thresh=thresh)
plt.show()
4 changes: 2 additions & 2 deletions examples/plot_zdr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import matplotlib.pyplot as plt

# Read in example data
obj = read_netcdf(radtraq.tests.sample_files.EXAMPLE_XSAPR)
ds = read_netcdf(radtraq.tests.sample_files.EXAMPLE_XSAPR)
thresh = {'cross_correlation_ratio_hv': [0.995, 1], 'reflectivity': [10, 30], 'range': [1000, 3000]}
# Call RadTraQ function
results = radtraq.proc.calc_zdr_offset(obj, zdr_var='differential_reflectivity', thresh=thresh)
results = radtraq.proc.calc_zdr_offset(ds, zdr_var='differential_reflectivity', thresh=thresh)

print('Zdr Bias: ' + '%.2f' % results['bias'])

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# List required packages in this file, one per line
pandas<2.0
act-atmos
numpy
scipy
xarray
matplotlib
cython
netcdf4
act-atmos
pint

0 comments on commit 7c90dcd

Please sign in to comment.