Skip to content

Commit

Permalink
Merge branch 'main' into pfs_repr_html
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller authored Oct 5, 2023
2 parents 2147417 + 4929b6f commit 3f8dd1c
Show file tree
Hide file tree
Showing 86 changed files with 3,144 additions and 2,097 deletions.
19 changes: 0 additions & 19 deletions .devcontainer/Dockerfile

This file was deleted.

46 changes: 26 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{
"name": "Miniconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers-contrib/features/black:1": {},
"ghcr.io/devcontainers-contrib/features/flake8:1": {}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip install -e ."
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"postCreateCommand": "pip3 install --user -e .'[dev,test,notebooks]'",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"GitHub.vscode-pull-request-github",
"charliermarsh.ruff"

],
"settings": {
"editor.formatOnSave": true,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"python.formatting.provider": "black"
}
}
}
}
3 changes: 0 additions & 3 deletions .devcontainer/noop.txt

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build documentation (don't publish)

on:
push:
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install MIKE IO
run: |
pip install .[dev]
- name: Sphinx Build
run: |
cd docs
make html
- name: Upload documentation
uses: actions/upload-artifact@v2
with:
name: html
path: docs/_build/html
6 changes: 3 additions & 3 deletions .github/workflows/downstream_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Install mikeio
run: |
pip install .
- name: Test fmskill from github
- name: Test modelskill from github
run: |
git clone --depth 1 https://github.com/DHI/fmskill.git
cd fmskill
git clone --depth 1 https://github.com/DHI/modelskill.git
cd modelskill
pip install .[test]
pytest
6 changes: 3 additions & 3 deletions .github/workflows/full_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]

python-version: [3.8, 3.9, "3.10","3.11"]
python-version: [3.8, "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -47,5 +47,5 @@ jobs:
pytest --cov=mikeio tests --ignore tests/performance/ --ignore tests/notebooks/ --disable-warnings
- name: Test docstrings with doctest
run: make doctest
#- name: Static type check
# run: make typecheck
- name: Static type check
run: make typecheck
4 changes: 4 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build wheel twine
- name: Install mikeio
run: pip install .[test]
- name: Test
run: pytest
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/quick_test.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ cov_annotate
htmlcov

docs/_build
\tmp
\tmp
.venv/
16 changes: 16 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cff-version: 1.2.0
message: If you use this software, please cite it as below.
authors:
- family-names: Andersson
given-names: Johan Henrik
affiliation: DHI
- family-names: Mariegaard
given-names: Jesper Sandvig
affiliation: DHI
title: "MIKE IO"
license: BSD-3-Clause
repository-code: 'https:///github.com/DHI/mikeio'
url: "https://dhi.github.io/mikeio/"
version: 1.6.1
date-released: 2023-06-09

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ perftest:
pytest tests/performance/ --durations=0

typecheck:
mypy mikeio/dataset/*.py
mypy mikeio/

coverage:
pytest --cov-report html --cov=mikeio tests/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Read, write and manipulate dfs0, dfs1, dfs2, dfs3, dfsu and mesh files.

MIKE IO facilitates common data processing workflows for [MIKE files in Python](https://www.mikepoweredbydhi.com/products/mike-for-developers#io).

[![YouTube](images/youtube1.png)](http://www.youtube.com/watch?v=Jm0iAeK8QW0)
[![YouTube](https://raw.githubusercontent.com/DHI/mikeio/main/images/youtube1.png)](http://www.youtube.com/watch?v=Jm0iAeK8QW0)

[![YouTube](images/youtube2.png)](http://www.youtube.com/watch?v=0oVedpx9zAQ)
[![YouTube](https://raw.githubusercontent.com/DHI/mikeio/main/images/youtube2.png)](http://www.youtube.com/watch?v=0oVedpx9zAQ)

## Requirements
* Windows or Linux operating system
Expand Down Expand Up @@ -90,8 +90,8 @@ TOTAL 8696 756 91%

It is possible to run MIKE IO in your favorite cloud notebook environment e.g. [Deepnote](https://deepnote.com/), [Google Colab](https://colab.research.google.com/), etc...

![DeepNote](images/deepnote.png)
![DeepNote](https://raw.githubusercontent.com/DHI/mikeio/main/images/deepnote.png)

![Colab](images/colab.png)
![Colab](https://raw.githubusercontent.com/DHI/mikeio/main/images/colab.png)


17 changes: 15 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# -- Project information -----------------------------------------------------

project = "MIKE IO"
copyright = "2022, Henrik Andersson, Jesper Mariegaard, Marc Ridler,"
author = "Henrik Andersson, Jesper Mariegaard, Marc Ridler"
copyright = "2023, DHI"
author = "Henrik Andersson, Jesper Mariegaard"
release = ""

# -- General configuration ---------------------------------------------------
Expand All @@ -37,6 +37,19 @@
"myst_parser",
]

# inspired by https://github.com/pydata/xarray/blob/main/doc/conf.py

autodoc_typehints = "none"

# Napoleon configurations

napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_use_param = False
napoleon_use_rtype = False
napoleon_preprocess_types = True


# Configuration to include links to other project docs when referencing
# functions/classes
intersphinx_mapping = {
Expand Down
6 changes: 3 additions & 3 deletions docs/data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

MIKE IO has these primary data structures:

* [Dataset](Dataset) - a collection of DataArrays corresponding to the contents of a dfs file; typically obtained from {py:meth}`mikeio.read`
* [DataArray](DataArray) - data and metadata corresponding to one "item" in a dfs file.
* [**Dataset**](Dataset) - a collection of DataArrays corresponding to the contents of a dfs file; typically obtained from {py:meth}`mikeio.read`
* [**DataArray**](DataArray) - data and metadata corresponding to one "item" in a dfs file.
* **Geometry** - spatial description of the data in a dfs file; comes in different flavours: [Grid1D](Grid1D), [Grid2D](Grid2D), [Grid3D](Grid3D), [GeometryFM](GeometryFM), [GeometryFM3D](GeometryFM3D), etc. corresponding to different types of dfs files.
* **Dfs** - an object returned by `dfs = mikeio.open()` containing the metadata (=header) of a dfs file ready for reading the data (which can be done with `dfs.read()`); exists in different specialized versions: [Dfs0](Dfs0), [Dfs1](Dfs1), [Dfs2](Dfs2), [Dfs3](Dfs3), [Dfsu2DH](Dfsu2DH), [Dfsu3D](Dfsu3D), [Dfsu2DV](Dfsu2DV), [DfsuSpectral](DfsuSpectral),
* **Dfs** - an object returned by `dfs = mikeio.open()` containing the metadata (=header) of a dfs file ready for reading the data (which can be done with `dfs.read()`); exists in different specialized versions: [Dfs0](Dfs0), [Dfs1](Dfs1), [Dfs2](Dfs2), [Dfs3](Dfs3), [Dfsu2DH](Dfsu2DH), [Dfsu3D](Dfsu3D), [Dfsu2DV](Dfsu2DV), [DfsuSpectral](DfsuSpectral).

6 changes: 3 additions & 3 deletions docs/dataarray.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DataArray

The [DataArray](DataArray) is the common MIKE IO data structure
The [DataArray](mikeio.DataArray) is the common MIKE IO data structure
for *item* data from dfs files.
The {py:meth}`mikeio.read` methods returns a Dataset as a container of DataArrays (Dfs items)

Expand Down Expand Up @@ -98,7 +98,7 @@ The plotting of a DataArray is context-aware meaning that plotting behaviour dep
>>> da.plot.mesh()
```

See details in the [API specification](_DatasetPlotter) below and in the bottom of the relevant pages e.g. [DataArray Plotter Grid2D API](_DataArrayPlotterGrid2D) on the dfs2 page.
See details in the [API specification](mikeio.dataset._data_plot._DataArrayPlotter) below and in the bottom of the relevant pages e.g. [DataArray Plotter Grid2D API](dfs2.md#dataarray-plotter-grid2d-api) on the dfs2 page.



Expand Down Expand Up @@ -175,7 +175,7 @@ Other methods that also return a DataArray:
A DataArray `da` can be plotted using `da.plot`.

```{eval-rst}
.. autoclass:: mikeio.dataarray._DataArrayPlotter
.. autoclass:: mikeio.dataset._data_plot._DataArrayPlotter
:members:
```

Expand Down
8 changes: 4 additions & 4 deletions docs/dataset.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Dataset

The [Dataset](Dataset) is the MIKE IO data structure
The [Dataset](mikeio.Dataset) is the MIKE IO data structure
for data from dfs files.
The {py:meth}`mikeio.read` methods returns a Dataset as a container of [DataArrays](dataarray) (Dfs items). Each DataArray has the properties, *item*, *time*, *geometry* and *values*. The time and geometry are common to all DataArrays in the Dataset.
The {py:meth}`mikeio.read` methods returns a Dataset as a container of [DataArrays](mikeio.DataArray) (Dfs items). Each DataArray has the properties, *item*, *time*, *geometry* and *values*. The time and geometry are common to all DataArrays in the Dataset.

The Dataset has the following primary properties:

Expand Down Expand Up @@ -113,7 +113,7 @@ In most cases, you will *not* plot the Dataset, but rather it's DataArrays. But
* dfs0-Dataset : plot all items as timeseries with ds.plot()
* scatter : compare two items using ds.plot.scatter(x="itemA", y="itemB")

See details in the [API specification](_DatasetPlotter) below.
See details in the [API specification](Dataset Plotter API) below.


## Properties
Expand Down Expand Up @@ -189,7 +189,7 @@ Other methods that also return a Dataset:
## Dataset Plotter API

```{eval-rst}
.. autoclass:: mikeio.dataset._DatasetPlotter
.. autoclass:: mikeio.dataset._data_plot._DatasetPlotter
:members:
```

Expand Down
Loading

0 comments on commit 3f8dd1c

Please sign in to comment.