### Install PyGridMET using pip Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Installation command for PyGridMET using pip. ```console $ pip install pygridmet ``` -------------------------------- ### Install Local Copy and Create Virtual Environment Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Instructions to install the local copy of PyGridMET into a virtual environment using mamba. ```shell $ cd pygridmet/ $ mamba env create -f ci/requirements/environment-dev.yml $ mamba activate pygridmet-dev $ python -m pip install . --no-deps ``` -------------------------------- ### Run a Subset of Tests Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Example command to run a specific subset of tests using nox. ```shell $ nox -s tests -- -n=1 -k "test_name1 or test_name2" ``` -------------------------------- ### Get GridMET data by geometry Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Example of retrieving daily precipitation and minimum temperature data for a given basin geometry. ```python from pynhd import NLDI import pygridmet as gridmet geometry = NLDI().get_basins("01031500").geometry[0] var = ["pr", "tmmn"] dates = ("2000-01-01", "2000-06-30") daily = gridmet.get_bygeom(geometry, dates, variables=var, snow=True) ``` -------------------------------- ### Install PyGridMET using Conda Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Installation command for PyGridMET from the conda-forge repository using Conda. ```console $ conda install -c conda-forge pygridmet ``` -------------------------------- ### Run Linting and Type-Checking with System Python Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Alternative commands to run linting and type-checking tests using the system's Python 3.11 if it's already installed. ```shell $ mamba create -n py38 python=3.8 nox tomli pre-commit codespell gdal $ mamba activate py38 $ nox ``` -------------------------------- ### Get GridMET data by coordinates with custom CRS Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Example of retrieving GridMET data using coordinates and specifying the coordinate reference system. ```python coords = (-1431147.7928, 318483.4618) crs = 3542 dates = ("2000-01-01", "2006-12-31") data = gridmet.get_bycoords(coords, dates, variables=var, loc_crs=crs) ``` -------------------------------- ### CLI command for downloading CONUS data Source: https://github.com/hyriver/pygridmet/blob/main/HISTORY.rst Example of how to use the pygridmet CLI to download daily meteorological data for the contiguous United States (CONUS). ```bash pygridmet conus -y 2010 -v tmmn ``` -------------------------------- ### Get GridMET data by multiple coordinates as xarray Dataset Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Example of retrieving GridMET data for multiple coordinates and returning the results as an xarray Dataset. ```python coords = [(-94.986, 29.973), (-95.478, 30.134)] idx = ["P1", "P2"] clm_ds = gridmet.get_bycoords(coords, range(2000, 2021), coords_id=idx, to_xarray=True) ``` -------------------------------- ### Create Environments for Linting and Testing Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Commands to create separate mamba environments for linting, type-checking, and running tests. ```shell $ mamba create -n py11 python=3.11 nox tomli pre-commit codespell gdal $ mamba activate py11 $ nox -s pre-commit $ nox -s type-check $ mamba create -n py38 python=3.8 nox tomli pre-commit codespell gdal $ mamba activate py38 $ nox -s tests ``` -------------------------------- ### Tag and Push for Deployment Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Commands to tag a new release version and push it, which triggers deployment via GitHub Actions. ```shell $ git tag -a vX.X.X -m "vX.X.X" $ git push --follow-tags ``` -------------------------------- ### PyGridMET Command-Line Interface Help Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Help message for the PyGridMET command-line interface. ```console $ pygridmet -h Usage: pygridmet [OPTIONS] COMMAND [ARGS]... Command-line interface for PyGridMET. Options: -h, --help Show this message and exit. Commands: ``` -------------------------------- ### Geometry Sub-command Help Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Displays the help message for the 'pygridmet geometry' command, detailing its usage, FPATH requirements for shapefiles or geopackages, and available options. ```console $ pygridmet geometry -h Usage: pygridmet geometry [OPTIONS] FPATH Retrieve climate data for a dataframe of geometries. FPATH: Path to a shapefile (.shp) or geopackage (.gpkg) file. This file must have four columns and contain a ``crs`` attribute: - ``id``: Feature identifiers that gridmet uses as the output netcdf filenames. - ``start``: Start time. - ``end``: End time. - ``geometry``: Target geometries. - ``snow``: (optional) Separate snowfall from precipitation, default is ``False``. Examples: $ pygridmet geometry geo.gpkg -v pr -v tmmn Options: -v, --variables TEXT Target variables. You can pass this flag multiple times for multiple variables. -s, --save_dir PATH Path to a directory to save the requested files. Extension for the outputs is .nc for geometry and .csv for coords. --disable_ssl Pass to disable SSL certification verification. -h, --help Show this message and exit. ``` -------------------------------- ### Coords Sub-command Help Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Displays the help message for the 'pygridmet coords' command, outlining its usage, FPATH requirements, and available options. ```console $ pygridmet coords -h Usage: pygridmet coords [OPTIONS] FPATH Retrieve climate data for a list of coordinates. FPATH: Path to a csv file with four columns: - ``id``: Feature identifiers that gridmet uses as the output netcdf filenames. - ``start``: Start time. - ``end``: End time. - ``lon``: Longitude of the points of interest. - ``lat``: Latitude of the points of interest. - ``snow``: (optional) Separate snowfall from precipitation, default is ``False``. Examples: $ cat coords.csv id,lon,lat,start,end california,-122.2493328,37.8122894,2012-01-01,2014-12-31 $ pygridmet coords coords.csv -v pr -v tmmn Options: -v, --variables TEXT Target variables. You can pass this flag multiple times for multiple variables. -s, --save_dir PATH Path to a directory to save the requested files. Extension for the outputs is .nc for geometry and .csv for coords. --disable_ssl Pass to disable SSL certification verification. -h, --help Show this message and exit. ``` -------------------------------- ### Create a Branch for Local Development Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Command to create a new branch for bug fixes or feature development. ```shell $ git checkout -b bugfix-or-feature/name-of-your-bugfix-or-feature $ git push ``` -------------------------------- ### Clone and Add Upstream Remote Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Steps to clone your forked repository and add the main PyGridMET repository as an upstream remote. ```shell $ git clone git@github.com:your_name_here/pygridmet.git $ git remote add upstream git@github.com:hyriver/pygridmet.git ``` -------------------------------- ### Commit Changes Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Commands to add all changes, commit them with a descriptive message indicating the type of change, and push to the branch. ```shell $ git add . $ git commit -m "ENH: A detailed description of your changes." $ git push origin name-of-your-branch ``` -------------------------------- ### Fetch Upstream and Merge Source: https://github.com/hyriver/pygridmet/blob/main/CONTRIBUTING.rst Commands to fetch the latest updates from the upstream repository and merge them into your current branch. ```shell $ git fetch upstream $ git merge upstream/name-of-your-branch ``` -------------------------------- ### Citation Source: https://github.com/hyriver/pygridmet/blob/main/README.rst Citation for HyRiver packages in BibTeX format. ```bibtex @article{Chegini_2021, author = {Chegini, Taher and Li, Hong-Yi and Leung, L. Ruby}, doi = {10.21105/joss.03175}, journal = {Journal of Open Source Software}, month = {10}, number = {66}, pages = {1--3}, title = {{HyRiver: Hydroclimate Data Retriever}}, volume = {6}, year = {2021} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.