Skip to content

Commit 3f9f172

Browse files
authored
Merge pull request #202 from ESGF/pid_url_fix
Pid url fix
2 parents a56c2a3 + 457942a commit 3f9f172

File tree

6 files changed

+22
-24
lines changed

6 files changed

+22
-24
lines changed

docs/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The esgcet package for ESGF Publication
2-
=======================================
1+
The esgcet package for ESGF Publication - Beta release 13
2+
=========================================================
33

44
Esgcet is a package of publisher commands for publishing to the `ESGF
55
<https://esgf-node.llnl.gov/projects/esgf-llnl/>`_ search database.
@@ -8,10 +8,12 @@ Esgcet is a package of publisher commands for publishing to the `ESGF
88
TL;DR
99
-----
1010

11-
if you have conda you can install the publisher wih the following into a fresh environment:
11+
if you have conda you can install the publisher wih the following into a fresh environment, and update to the latest version:
1212
::
1313
conda create -n esgf-pub -c conda-forge -c esgf-forge esgcet
1414
conda activate esgf-pub
15+
pip install esgcet # upgrade
16+
esgpublish --version # Ensure you have upgraded to v5.1.0-b13
1517
esgpublish # will print the usage information.
1618

1719
You may also look at the inital ``~/.esg/esg.ini`` and fill in the missing information based on the provided examples.

docs/install.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
Installation
22
============
33

4-
You can install the ``esg-publisher`` (aka the ``esgcet`` Python package) one of two ways: conda, or git.
5-
6-
For the **basic** installation: to install esgcet using conda, use the following to create a new environment populated with the publisher software and required packages: ::
7-
8-
conda create -n esgf-pub -c esgf-forge -c conda-forge esgcet
9-
conda activate esgf-pub
10-
11-
Other installation methods require several pre-requisites, as described below.
12-
134
Conda & Required Packages
145
-------------------------
156

@@ -18,21 +9,20 @@ We recommend creating a conda env before installing ``esgcet`` ::
189
conda create -n esgf-pub -c conda-forge -c esgf-forge pip libnetcdf cmor autocurator esgconfigparser
1910
conda activate esgf-pub
2011

21-
NOTE: if you install esgcet using conda below, the cmor package (different from tables) should be installed at the time you install esgcet automatically, and having cmor in your env may cause conflicts (but not always).
2212

2313
You will also need to install ``esgfpid`` using pip::
2414

2515
pip install esgfpid
2616

27-
NOTE: you will need a functioning version of ``autocurator`` in order to run the publisher, in addition to downloading the CMOR tables. See those pages for more info.
17+
NOTE: you will need a functioning version of ``autocurator`` in order to run the publisher, in addition to downloading the CMOR tables. See those pages for more info. The ``autocurator`` package in the ``esgf-forge`` conda channel provides a working albeit not the most recent version of this module.
2818

29-
Conda Install
30-
-------------
19+
Pip Install
20+
-----------
3121

3222
Use the following command to install ``esgcet`` into a previously created conda environment: ::
3323

34-
conda install -c esgf-forge -c conda-forge esgcet
35-
24+
conda activate esgf-pub
25+
pip install esgcet
3626

3727

3828
Installing esgcet via git

docs/whatsnew.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Release Notes
22
=============
33

4+
b5.1.0-b13
5+
----------
6+
7+
* **BUGFIX**: corrected file URL format for PID/Handle publishing (previously published URLs via v5.* were malformed).
8+
* CMIP6 Cloned project support
9+
* **NOTE**: this version is unavailable on Conda (``esgf-forge`` channel), please use ``pip install esgcet`` and confirm the upgrade with ``esgpublish --version``.
10+
411
b5.1.0-b11
512
----------
613

pkg/esgcet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.1.0b12"
1+
__version__ = "5.1.0b13"

pkg/esgcet/mk_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def get_file(self, mapdata, fn_trid):
248248
exit(1)
249249

250250
ret["url"] = self.gen_urls(self.data_roots[proj_root], rel_path)
251+
ret["publish_path"] = f"{self.data_roots[proj_root]}/{rel_path}"
251252
if "number_of_files" in ret:
252253
ret.pop("number_of_files")
253254
else:

pkg/esgcet/pid_cite_pub.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
import traceback
44
import esgcet.logger as logger
55

6+
67
log = logger.Logger()
78

89
silent = False
910
verbose = False
1011
pid_creds = {}
1112
import traceback
1213

13-
def get_url(arr):
14-
return arr[0].split('|')[0]
15-
1614
class ESGPubPidCite(object):
1715
""" for PID services wraps calls to obtain a PID, add to records and generate citiation metadata """
1816

@@ -122,7 +120,7 @@ def pid_flow_code(self):
122120
file_handle=file_rec['tracking_id'],
123121
checksum=file_rec['checksum'],
124122
file_size=file_rec['size'],
125-
publish_path=get_url(file_rec['url']),
123+
publish_path=file_rec['publish_path'],
126124
checksum_type=file_rec['checksum_type'],
127125
file_version=file_rec['version'] )
128126
else:
@@ -131,7 +129,7 @@ def pid_flow_code(self):
131129
file_handle=file_rec['tracking_id'],
132130
checksum=file_rec['checksum'],
133131
file_size=file_rec['size'],
134-
publish_path=get_url(file_rec['url']),
132+
publish_path=file_rec['publish_path'],
135133
checksum_type=file_rec['checksum_type'],
136134
file_version=file_rec['version'])
137135
if pid_wizard:

0 commit comments

Comments
 (0)