Skip to content

Commit

Permalink
Merge pull request #222 from ESGF/bugfix_version_yaml
Browse files Browse the repository at this point in the history
update to fix
  • Loading branch information
sashakames authored Sep 19, 2023
2 parents c0aa590 + c54244f commit 15f3a89
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 31 deletions.
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# ESGF Publisher

`v5.2.0` is the latest release of the ESGF Publisher. We recommend everyone to upgrade to this version.
`v5.2.1` is the latest release of the ESGF Publisher. We recommend everyone to upgrade to this version.

See: https://esg-publisher.readthedocs.io/en/latest
See: https://esg-publisher.readthedocs.io/

### Release notes:

#### v5.2.1
* **BUGFIX**: Missing `import` caused ``esgpublish`` calls to fail in most cases.

#### v5.2.0 - Major release
* Migrated configuration from `.ini` format to `.yaml`. Use `esgmigrate` to convert existing `.ini` files.
* Added XArray for NetCDF file reading. Disable autocurator in settings to use or add `--xarray`
Expand Down
9 changes: 5 additions & 4 deletions docs/cmor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ CMOR
====

Before running the publisher for CMIP6, you will need to obtain a directory of CMOR tables, used by PrePARE to check the metadata of your files.
You can get this directory either using ``esgprep`` or by cloning the git repository.
You can get this directory either using ``esgprep`` or by cloning the git repository. CMOR/PrePARE is available for Linux and MacOS Intel. Mac Apple M1 systems are not currently supported.

NOTE: ``esgprep`` uses python 2.6 or greater, but less than python 3.0. Configure your virtual environment as needed.

esgprep
-------

You can install ``esgprep`` using pip::
You can install ``esgprep`` (esgf-prepare) using pip::

pip install esgprep

Expand All @@ -17,8 +19,6 @@ You can also clone their git repository and run setup.py::
cd esgf-prepare
python setup.py install

NOTE: ``esgprep`` uses python 2.6 or greater, but less than python 3.0. Configure your virtual environment as needed.

Following install, simply run::

esgfetchtables
Expand All @@ -28,6 +28,7 @@ You can specify project using ``--project`` and the output directory using ``--t
esgfetchtables --project CMIP6 --table-dir <path>

Once you have fetched the tables, you can update the ``cmor_path`` variable in your config file, or specify it at run time in the command line.
See https://esgf.github.io/esgf-prepare/ for more information.

Clone Git Repository
--------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_glpi_theme
import sphinx_rtd_theme

# -- Project information -----------------------------------------------------

Expand All @@ -22,7 +22,7 @@
author = 'Elysia Witham, Sasha Ames'

# The full version, including alpha/beta/rc tags
release = '5.1.0b11'
release = '5.2.1'


# -- General configuration ---------------------------------------------------
Expand All @@ -49,8 +49,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'glpi'
html_theme_path = sphinx_glpi_theme.get_html_themes_path()
html_theme = 'sphinx_rtd_theme'
#html_theme_path = sphinx_rtd_theme.get_html_themes_path()
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
13 changes: 6 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The esgcet package for ESGF Publication - Version 5.2.0
=========================================================
The esgcet package for ESGF Publication - Version 5.2.1
=======================================================

Esgcet is a package of publisher commands for publishing to the `ESGF
<https://esgf-node.llnl.gov/projects/esgf-llnl/>`_ search database.
Expand All @@ -8,15 +8,14 @@ Esgcet is a package of publisher commands for publishing to the `ESGF
TL;DR
-----

if you have conda you can install the publisher wih the following into a fresh environment, and update to the latest version:
::
conda create -n esgf-pub -c conda-forge -c esgf-forge esgcet
If you have conda on a Linux system you can install the publisher wih the following into a fresh environment, and update to the latest version:::

conda create -n esgf-pub -c conda-forge pip cmor # most commun
conda activate esgf-pub
pip install esgcet
esgpublish --version # Ensure you have upgraded to v5.2.0
esgpublish --version # Ensure you have upgraded to v5.2.1
esgpublish # will print the usage information.

You may also look at the inital ``~/.esg/esg.yaml`` and update to fit your site configuration.

.. toctree::
:maxdepth: 2
Expand Down
19 changes: 15 additions & 4 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Use the following command to install ``esgcet`` into a previously created conda

conda activate esgf-pub
pip install esgcet
esgpublish --version # Ensure you have upgraded to v5.2.0
esgpublish --version # Ensure you have upgraded to v5.2.1


Installing esgcet via git
Expand All @@ -37,15 +37,26 @@ To install esgcet by cloning our github repository (useful if you want to modiy
git checkout refactor-esgf # NOTE this is a temporary fix prior to a merge into the master branch
cd src/python
pip install -e . # You can modify the source in place
esgpublish --version # check v5.2.0 has been installed
esgpublish --version # Confirm that v5.2.1 has been installed

Now you will be able to call all commands in this package from any directory.


Now you will be able to call all commands in this package from any directory. A default config file, ``esg.yaml`` will populate in ``$HOME/.esg`` where ``$HOME`` is your home directory.

NOTE: if you are intending to publish CMIP6 data, the publisher will run the PrePARE module to check all file metadata. To enable this procedure, it is necessry to download CMOR tables before the publisher will successfully run. See those pages for more info.


Config File (esg.yaml)
---------------------
----------------------

Starting with ``v5.2.0`` the ESGF Publisher uses a .yaml file for configuration. Download a copy of the default config file ``esg.yaml`` to the default directory,
or see below regarding migrating a previous config ::

wget https://raw.githubusercontent.com/ESGF/esg-publisher/refactor/src/python/esg.yaml
mkdir $HOME/.esg
cp esg.yaml $HOME/.esg



The config file will contain the following settings:

Expand Down
4 changes: 4 additions & 0 deletions docs/whatsnew.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

v5.2.1
------
* **BUGFIX**: Missing `import` caused ``esgpublish`` calls to fail in most cases.

v5.2.0
------

Expand Down
1 change: 1 addition & 0 deletions src/python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include esg.yaml
2 changes: 1 addition & 1 deletion src/python/esgcet/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.2.0"
__version__ = "5.2.1"
1 change: 1 addition & 0 deletions src/python/esgcet/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import esgcet.esgmigrate as em
import esgcet.logger as logger
import esgcet
import yaml

log = logger.ESGPubLogger()
Expand Down
17 changes: 8 additions & 9 deletions src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
FULLPATH = HOME + '/.esg'
DEFAULT_ESGINI = '/esg/config/esgcet'

if not os.path.exists(FULLPATH):
os.makedirs(FULLPATH)
# if not os.path.exists(FULLPATH):
# os.makedirs(FULLPATH)

if os.path.exists(FULLPATH + "/esg.yaml"):
make_config = False
else:
make_config = True
# if os.path.exists(FULLPATH + "/esg.yaml"):
# make_config = False
# else:

make_config = True

if make_config:
setup(
Expand Down Expand Up @@ -53,9 +54,7 @@
'esgupdate=esgcet.esgupdate:main',
'esgmapconv=esgcet.esgmapconv:main',
'esgmigrate=esgcet.migratecmd:main',
'esgunpublish=esgcet.esgunpublish:main']},
data_files=[(FULLPATH, ['esg.yaml'])]

'esgunpublish=esgcet.esgunpublish:main']}
)
else:
setup(
Expand Down

0 comments on commit 15f3a89

Please sign in to comment.