Skip to content

Commit

Permalink
Updated documentation and history for v1.3.1
Browse files Browse the repository at this point in the history
This should also fix the Sphinx configuration so that RTD can import
ginput and include the autodocumented modules.
  • Loading branch information
Joshua Laughner committed Dec 19, 2024
1 parent 3bd4186 commit 3bd3f7d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
.idea
ginput/testing/plots/.*.pdf
run_ginput.py
# this will need to be unignored later
^docs
doc/build/**/*
build/**/*
dist/**/*
.condaenv/**/*
.condaenv/**/*
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Ginput Version History

## 1.3.1

This release improves the ergonomics of including the time-varying O2 mole fraction
by providing an option to the `O2MeanMoleFractionRecord` and a command line flag for
the `vmr` and `rlvmr` subcommands to automatically download the necessary data and
create/update the O2 mole fraction data file when creating `.vmr` files.

## 1.3.0

This release primarily adds the ability to calculate a time-varying O2 mole fraction,
Expand Down
3 changes: 3 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import re
import sys
# Include the directory with ginput in it so autodoc finds the modules
sys.path.insert(0, os.path.abspath('../..'))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand Down
17 changes: 9 additions & 8 deletions doc/source/ginput_usage/making_vmr_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ However, please note that GEOS FP is _not_ the standard met source for TCCON and
## Creating .vmr files for dates

As with the previous steps, we will use the `run_ginput.py` script to call ginput.
Before we can generate our `.vmr` files, we need to download one other set of input data, needed to calculate the global mean O2 mole fraction.
To do this, simply run `./run_ginput.py update_fo2`; this will download the necessary data and write a file containing the mean O2 mole fractions calculated at `ginput/data/o2_mean_dmf.dat`.
This command only needs run about once per year to update the data, but since it's pretty quick, running it more ofter (once a month or once a week even) is not a problem.

```{note}
The `update_fo2` subcommand was added in ginput v1.3.
If you are using an older version of ginput, you will not have that subcommand, and ginput will not add the O2 mole fractions to the `.vmr` file headers.
```

To generate the actual `.vmr` files, we use the `vmr` subcommand.
We'll assume that we are going to generate the `.vmr` files corresponding to the `.mod` files we made in {ref}`usage-mod`, so:
Expand All @@ -36,10 +28,18 @@ $ ./run_ginput.py vmr \
--base-vmr-file ginput/testing/test_input_data/summer_35N.vmr \
--integral-file ginput/testing/test_input_data/ap_51_level_0_to_70km.gnd \
--save-path VMR_FILE_DIR \
--auto-update-fo2-file \
20180101 \
MOD_FILE_DIR/fp/xx/vertical
```

```{note}
ginput v1.3 added a requirement for O2 mole fraction data when generating the `.vmr` files.
For v1.3, you would have to execute the command `./run_ginput update_fo2` once before creating any `.vmr` files.
From v1.3.1 on, you can use the `--auto-update-fo2-file` flag for the `vmr` subcommand as shown below.
If you are using a version of ginput before 1.3, you will not have the `update_fo2` subcommand nor the `--auto-update-fo2-file` flag, and ginput will not add the O2 mole fractions to the `.vmr` file headers.
```

This part of ginput requires several look up tables to be pre-calculated.
The first time you run it, it will calculate them and save them as netCDF files.
On successive runs, it will load the netCDF files unless any of the inputs or code needed to make those files have changed since the last run.
Expand Down Expand Up @@ -84,6 +84,7 @@ $ ./run_ginput.py rlvmr \
--product fpit \
--mod-root-dir MOD_FILE_DIR \
--save-path VMR_FILE_DIR \
--auto-update-fo2-file \
$gggpath/runlogs/gnd/pa_ggg_benchmark.grl
```

Expand Down
2 changes: 1 addition & 1 deletion ginput/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# be sure to update in setup.py as well
# and man/conf.py
# please follow semantic versioning: https://semver.org/
__version__ = '1.3.0'
__version__ = '1.3.1'
8 changes: 7 additions & 1 deletion install-dev-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ if [[ $? != 0 ]]; then
echo "Warning: dot is not installed or not on your path. Some graphs in the documentation will not build. Please install graphviz with your package manager."
fi

conda install -c conda-forge sphinx sphinx_rtd_theme myst-parser linkify-it-py
if [[ $GGG_USE_MICROMAMBA == "1" ]]; then
CMD=micromamba
else
CMD=conda
fi

${CMD} install -c conda-forge sphinx sphinx_rtd_theme myst-parser linkify-it-py
3 changes: 1 addition & 2 deletions man/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Joshua Laughner, Sebastien Roche, and Matthaeus Kiel'

# The full version, including alpha/beta/rc tags
release = '1.3.0'
release = '1.3.1'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -68,4 +68,3 @@
[author], 1),
('upnoaaman', 'ginput.upnoaa', 'Ginput: Update MLO/SMO monthly files', [author], 1)
]

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
long_description_content_type='text/markdown',
author='Joshua Laughner, Sebastien Roche, Matthaeus Kiel',
author_email='jlaugh@caltech.edu',
version='1.3.0', # make sure stays in sync with the version in ginput/__init__.py
version='1.3.1', # make sure stays in sync with the version in ginput/__init__.py
url='',
install_requires=[
'astropy>=3.1.2',
Expand Down

0 comments on commit 3bd3f7d

Please sign in to comment.