Skip to content

Commit 1c125f2

Browse files
lee1043pochedls
andauthored
Add 'setup.py' for install
This update allows users to import xsearch in an individual conda environment. * add setup.py * update README.md to document alternate installation method using `setup.py` Co-authored-by: Stephen Po-Chedley <[email protected]>
1 parent f654bc2 commit 1c125f2

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ If the xsearch version is incremented you will receive a warning on import:
2222
2323
`xsearch` will create a file in your home directory to support version checking.
2424

25-
Alternatively, you can download the contents of this repository and import the package (or the `search.py` file). In this case, we suggest you watch the repository (in GitHub) so that you know when there are version changes.
25+
Alternatively, you can download the contents of this repository and import the package (or the `search.py` file). In this case, we suggest you watch the repository (in GitHub) so that you know when there are version changes. You can either add `export PYTHONPATH='/PATH/TO/YOUR/XSEARCH/'` in your `~/.bashrc` or use the following commend to make xsearch importable:
26+
27+
python setup.py install
2628

2729
`xsearch` is built around metadata logic documented in the [CMIP6 Global Attributes, DRS, Filenames, Directory Structure, and CV’s document](https://goo.gl/v1drZl). These logic underpin the filename and directory creation, written by [CMOR](https://cmor.llnl.gov/) and other CMIP-writing libraries. The [CMIP6 CMOR Tables](https://github.com/PCMDI/cmip6-cmor-tables/tree/master/Tables) (e.g. Amon - designate A=atmospheric realm, and mon=monthly frequency), similar logic underpinned the [CMIP5](https://github.com/PCMDI/cmip5-cmor-tables/tree/master/Tables) and [CMIP3](https://github.com/PCMDI/cmip3-cmor-tables/tree/master/Tables) phases.
2830

@@ -156,4 +158,4 @@ This isn't typically a problem if you specify an exact experiment, variable, and
156158

157159
### Acknowledgements
158160

159-
Much of the de-duplication logic and ideas from this are from the [durolib](https://github.com/durack1/durolib) library, created by Paul Durack [@durack1](https://github.com/durack1) to search for CMIP data. durolib handled [CDAT](https://cdat.llnl.gov/) xml files, which could be used to read in multi-file datasets. Logic to produce the xml files was refactored in [xagg](https://github.com/pochedls/xagg). xagg xmls are being phased out in favor the current approach: rapidly searchable json files, which allow the users to locate datasets and read them in with xarray based tools. Stephen Po-Chedley [@pochedls](https://github.com/pochedls/) produced the `xsearch` initial version.
161+
Much of the de-duplication logic and ideas from this are from the [durolib](https://github.com/durack1/durolib) library, created by Paul Durack [@durack1](https://github.com/durack1) to search for CMIP data. durolib handled [CDAT](https://cdat.llnl.gov/) xml files, which could be used to read in multi-file datasets. Logic to produce the xml files was refactored in [xagg](https://github.com/pochedls/xagg). xagg xmls are being phased out in favor the current approach: rapidly searchable json files, which allow the users to locate datasets and read them in with xarray based tools. Stephen Po-Chedley [@pochedls](https://github.com/pochedls/) produced the `xsearch` initial version.

setup.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from setuptools import find_packages, setup
2+
3+
version = '0.0.3'
4+
5+
packages = find_packages(include=['xsearch'])
6+
7+
setup(
8+
name="xsearch",
9+
version=version,
10+
author="@pochedls",
11+
description="xsearch search utility",
12+
url="https://github.com/pochedls/xsearch",
13+
packages=packages,
14+
)
15+

xsearch/__init__.py

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313

1414
# version
15-
__version__ = "0.0.4"
15+
__version__ = "0.0.5"
1616

1717
# since this software is installed centrally and may be updated
1818
# this section of code stores the xsearch version in a hidden

0 commit comments

Comments
 (0)