Repository: JGCRI/tethys

Issue:
JOSS Review: Missing item under documentation section for how to get support
Hi there,

I'm one of the reviewers for the JOSS paper on this package - openjournals/joss-reviews#5855. I've encountered one item that appears incomplete:

> Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) **Seek support**

I don't see in the README or documentation any notes for where someone would seek support. If this already exists, can you point me to it, and otherwise, I'd consider this a minor modification that needs addressing before I can check that item off.

Thank you!

Discussion:

Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d3eb368..29cd546 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,10 +1,13 @@
+---
 name: build
 
-on:
+on:    # yamllint disable-line rule:truthy
   push:
-    branches:
-      - dev
-      - main
+    branches-ignore:
+      - 'false'
+  pull_request:
+    branches-ignore:
+      - 'false'
 
 jobs:
   build:
@@ -30,7 +33,8 @@ jobs:
         - name: Install dependencies
           run: |
             python -m pip install --upgrade pip
-            python setup.py install
+            pip install click-default-group
+            pip install .
 
         - name: Test and generate coverage report on Linux
           run: |
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 93b453c..72a9109 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,9 +1,13 @@
+---
 name: "docs"
-on:
+
+on:    # yamllint disable-line rule:truthy
   push:
     branches:
-      - dev
-      - main
+      - 'main'
+  pull_request:
+    branches:
+      - 'main'
 
 jobs:
   docs:
diff --git a/.gitignore b/.gitignore
index bee424a..bbb6a02 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
 example.py
 
+# vs code
+.vscode
+
 # OS-specific files
 .DS_Store
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..fb70323
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+# How to contribute
+
+We welcome third-party patches, which are essential for advancing the science and architecture of Tethys.
+But there are a few guidelines that we ask contributors to follow, guidelines that ease the maintainers' organizational and logistical duties, while encouraging development by others.
+
+## Getting Started
+
+* Make sure you have a [GitHub account](https://github.com/signup/free).
+* **Open an issue** describing your proposed change or work (after making sure one does not already exist).
+  * Clearly describe the issue including steps to reproduce when it is a bug.
+  * Discuss how your change will affect Tethys, and thus whether it's MAJOR, MINOR, or a PATCH.
+  * Interact with the project maintainers to refine/change/prioritize your issue and identify what branch will be targeted (see below).
+* Trivial changes to comments or documentation do not require creating a new issue.
+
+## Making Changes
+
+* **Start your work on the correct branch**.
+  * All active devleopment will start off of the `dev` branch.  This represents our next version to be released.  All feature and bug fix branches are to made off of `dev`.
+  * If your change is a PATCH, it will typically be based on the current dev branch; if MINOR, the next minor release branch; if MAJOR, the next major release branch. For example, as of this writing there are branches `dev`, `rc1.2` and `rc2.0`, corresponding to the PATCH-MINOR-MAJOR start points respectively.
+  * We will never accept pull requests to the `main` branch.
+* Make sure your commit messages are descriptive but succinct, describing what was changed and why, and **reference the relevant issue number**. Make commits of logical units.
+* Make sure you have added the necessary tests for your changes. Tests should be included in the root `tests` directory and are facilitated using `pytest` which is installed with the development version of Tethys.  See more info on using `pytest` here:  https://docs.pytest.org/en/7.4.x/contents.html
+* Run _all_ the tests to assure nothing else was accidentally broken.
+
+## Submitting Changes
+
+* Submit a pull request.
+* **Your pull request should include one of the following two statements**:
+   * You hereby grant PNNL unlimited license to use your code in this version or any future version of Tethys.
+   * Somebody else owns the copyright on the code being contributed (e.g., your employer because you did it as part of your work for them); you are authorized by that owner to grant PNNL an unlimited license to use this code in this version or any future version of Tethys, and you hereby do so. All other rights to the code are reserved by the copyright owner.
+* The core team looks at Pull Requests on a regular basis, and will respond as soon as possible.
+
+
+# Additional Resources
+
+* [General GitHub documentation](http://help.github.com/)
+* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
diff --git a/README.md b/README.md
index b27934e..25d0a76 100644
--- a/README.md
+++ b/README.md
@@ -3,9 +3,21 @@
 [![docs](https://github.com/JGCRI/tethys/actions/workflows/docs.yml/badge.svg)](https://github.com/JGCRI/tethys/actions/workflows/docs.yml)
 [![DOI](https://zenodo.org/badge/104476654.svg)](https://zenodo.org/badge/latestdoi/104476654)
 
-# Summary
-Demand for water is often modeled as part of integrated human-Earth systems models, such as GCAM, which operate at coarse spatiotemporal scales in order to model long-term global economic linkages. Tethys was designed to downscale projections from such models, producing high-resolution water demand data consistent with global dynamics. This allows coupling with gridded hydrology models, which represent physical processes on much finer scales.
+# Tethys
 
-# Documentation
+Demand for water is often modeled as part of integrated human-Earth systems models, such as GCAM, which operate at coarse spatiotemporal scales in order to model long-term global economic linkages. `tethys` was designed to downscale projections from such models, producing high-resolution water demand data consistent with global dynamics. This allows coupling with gridded hydrology models, which represent physical processes on much finer scales.
+
+## Documentation
 Check out [Getting Started](https://jgcri.github.io/tethys/getting_started.html) for installation and basic usage.
 Details on methodology and advanced usage are available on the [User Guide](https://jgcri.github.io/tethys/user_guide.html).
+
+## Installation
+
+Install `tethys` using pip:
+
+`pip install tethys-downscale`
+
+
+## Contributing to Tethys
+
+Whether you find a typo in the documentation, find a bug, or want to develop functionality that you think will make Tethys more robust, you are welcome to contribute! See the full contribution guidelines in our [online documentation](https://jgcri.github.io/tethys/contributing.html).
diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst
index 94d8f7e..56e7219 100644
--- a/docs/source/getting_started.rst
+++ b/docs/source/getting_started.rst
@@ -21,7 +21,7 @@ As a prerequisite, you'll need to have `Python <https://www.python.org/downloads
 
 **tethys** can be installed from GitHub using pip::
 
-  pip install git+https://github.com/JGCRI/tethys
+  pip install tethys-downscale
 
 This will automatically install the dependencies. In order to avoid package version conflicts, consider using a virtual environment.
 
diff --git a/requirements.txt b/requirements.txt
index df3f346..427692f 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,4 +5,4 @@ pandas>=1.2.4
 netCDF4>=1.6
 dask>=2022.12.1
 xarray>=2022.09.0
-rioxarray>=0.12.4
\ No newline at end of file
+rioxarray>=0.12.4
diff --git a/setup.py b/setup.py
index 924dc39..825ada9 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,8 @@ setup(
             'sphinx-panels~=0.6.0',
             'sphinx-rtd-theme~=0.5.2',
             'sphinx-mathjax-offline~=0.0.1',
-            'twine~=3.4.1'
+            'twine~=3.4.1',
+            'click-default-group>=1.2.4'
         ]
     }
 )
diff --git a/tethys/__init__.py b/tethys/__init__.py
index 7bc7e24..aa64edc 100644
--- a/tethys/__init__.py
+++ b/tethys/__init__.py
@@ -1,4 +1,4 @@
 from .model import *
 from .utils.install_supplement import get_example_data, default_download_dir
 
-__version__ = "2.0.0"
+__version__ = "2.0.1"
diff --git a/tethys/datareader/easy_query.py b/tethys/datareader/easy_query.py
index 291e70b..723578e 100644
--- a/tethys/datareader/easy_query.py
+++ b/tethys/datareader/easy_query.py
@@ -34,11 +34,11 @@ def easy_query(variable, year_axis=None, **kwargs):
         year_axis = get_year_axis(variable)
 
     # query template
-    querystr = f"""<aQuery><dummyQuery title="">
+    querystr = f"""<dummyQuery title="">
     <axis1 name="axis">axis</axis1>
     <axis2 name="year">{variable}[@{year_axis}]</axis2>
     <xPath>{xpath}</xPath>
-    </dummyQuery></aQuery>"""
+    </dummyQuery>"""
 
     return gcamreader.Query(querystr)
 


Test patch:
diff --git a/tests/test_easy_query.py b/tests/test_easy_query.py
index e35bed2..d6597fc 100644
--- a/tests/test_easy_query.py
+++ b/tests/test_easy_query.py
@@ -1,3 +1,4 @@
+import difflib
 import unittest
 
 import tethys.datareader.easy_query as easy_query
@@ -12,8 +13,21 @@ class TestEasyQuery(unittest.TestCase):
     </dummyQuery>"""
 
     def test_easy_query(self):
-        query = easy_query.easy_query('demand-physical', sector=['Beef', 'Dairy'], technology='!water_td_*',
-                                      input=['*_water withdrawals', 'water_td_*_W'])
+        query = easy_query.easy_query(
+            'demand-physical', 
+            sector=['Beef', 'Dairy'], 
+            technology='!water_td_*',
+            input=['*_water withdrawals', 'water_td_*_W']
+        )
+
+        # identify error location
+        if query.querystr != TestEasyQuery.COMP_QUERY_STRING:
+            for i,s in enumerate(difflib.ndiff(TestEasyQuery.COMP_QUERY_STRING, query.querystr)):
+                if s[0]==' ': continue
+                elif s[0]=='-':
+                    print(u'Delete "{}" from position {}'.format(s[-1], i))
+                elif s[0]=='+':
+                    print(u'Add "{}" to position {}'.format(s[-1], i)) 
 
         self.assertEqual(query.querystr, TestEasyQuery.COMP_QUERY_STRING)
 
diff --git a/tests/test_regional.py b/tests/test_regional.py
index bfbecf0..e46e208 100644
--- a/tests/test_regional.py
+++ b/tests/test_regional.py
@@ -28,6 +28,9 @@ class TestRegional(unittest.TestCase):
 
     def test_load_region_data(self):
         gcamdb = os.path.join(os.path.dirname(__file__), 'data/testdb')
+        print(gcamdb)
+
+
         df = regional.load_region_data(gcamdb, sectors=['municipal water'])
 
         expected = pd.read_csv(os.path.join(os.path.dirname(__file__), 'data/testdb.csv'))