Skip to content

Commit

Permalink
Merge pull request #2 from ahuang11/main
Browse files Browse the repository at this point in the history
  • Loading branch information
chadhutchins182 authored Aug 23, 2022
2 parents 9789d6d + e8c33dc commit 2a99356
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 7 deletions.
39 changes: 39 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
**xNRL** helps you read NRL NWP output into xarray Datasets nested within Pandas DataFrames.

# Install
xNRL requires numpy, pandas, and xarray.

## Clone and install with pip
```bash
git clone https://github.com/U-S-NRL-Marine-Meteorology-Division/xnrl.git
cd xnrl
pip install -e .
```
> The `-e` makes the code editable.
>
> You can update the code with
> ```bash
> cd xnrl
> git pull origin main
> ```
## Install with Conda
Copy the [`environment_xnrl.yml`](./environment_xnrl.yml) file and create the Conda environment.
```bash
conda env create -f environment_xnrl.yml
```
> Note: This only installs the current main branch and does not let you edit the code. You can update xnrl (and all packages in the environment) with
> ```
> conda env update -f environment_xnrl.yml
>```
# Examples
```python
import xnrl
# Load COAMPS flatfiles into an xarray Dataset
fp = '<path>/*pre*00120*'
ds = xnrl.open_dataset(fp, model='COAMPS')
```
1 change: 1 addition & 0 deletions docs/main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xnrl.main
1 change: 1 addition & 0 deletions docs/util.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xnrl.util
34 changes: 34 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
site_name: xnrl
site_url: https://U-S-NRL-Marine-Meteorology-Division.github.io/xnrl
repo_url: https://github.com/U-S-NRL-Marine-Meteorology-Division/xnrl
edit_uri: /edit/main/docs/
markdown_extensions:
- admonition
- attr_list
- codehilite
- md_in_html
- meta
- pymdownx.highlight:
use_pygments: true
- pymdownx.superfences
- pymdownx.tabbed
plugins:
- search
- mkdocstrings:
handlers:
python:
rendering:
show_root_heading: True
show_object_full_path: False
show_category_heading: False
show_bases: False
show_signature: False
heading_level: 1
watch:
- xnrl/
- README.md

nav:
- Home: index.md
- Main: main.md
- Util: util.md
11 changes: 11 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pytest
black
flake8
mkdocs
mkdocs-material
mkdocstrings[python]
isort
pre-commit
mkdocs-gen-files
interrogate
coverage
34 changes: 27 additions & 7 deletions setup.cfg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[flake8]
exclude = .git,__pycache__,build,dist
per-file-ignores =
*/__init__.py: F401
setup.py:E501
setup.py:E121
# Match black line-length
max-line-length = 88
extend-ignore =
E203,

[isort]
multi_line_output = 3
include_trailing_comma = True
Expand All @@ -6,10 +17,19 @@ use_parentheses = True
ensure_newline_before_comments = True
line_length = 88

[flake8]
max-line-length = 88
extend-ignore = E203
per-file-ignores =
*/__init__.py: F401
xnrl/constant.py: E501
setup.py:E121
[tool:interrogate]
ignore-init-module = True
ignore_init_method = True
exclude = tests, setup.py, versioneer.py, docs, site
fail-under = 95
omit-covered-files = True

[coverage:run]
omit = tests/*, xnrl/_version.py

[coverage:report]
fail_under = 80
show_missing = True

[tool:pytest]
asyncio_mode = auto

0 comments on commit 2a99356

Please sign in to comment.