Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start converting docs over to quarto #99

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ jobs:
run: |
python -m pip install --upgrade pip

- name: Install mikeio
- name: Install mikeio1d
run: |
pip install .[dev,docs]

- name: Sphinx Build
- name: Build documentation
run: |
cd docs
make html
make docs

- name: Publish to GitHub Pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
publish_dir: docs/_site/
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ Release
.vs

# mikeio1d/bin folder
mikeio1d/bin/*.dll
mikeio1d/bin/*.pfs
mikeio1d/bin/*.ubg
mikeio1d/bin/*.xml
mikeio1d/bin/*so.5
mikeio1d/bin/**/*.dll
mikeio1d/bin/**/*.pfs
mikeio1d/bin/**/*.ubg
mikeio1d/bin/**/*.xml
mikeio1d/bin/**/*so.5

# Specific files
tests/testdata/network_river.mod.res1d
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docs: FORCE
cd docs && quarto add --no-prompt .
cd docs && quartodoc build
cd docs && quartodoc interlinks
quarto render docs

FORCE:
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
![logo](https://raw.githubusercontent.com/DHI/mikeio1d/main/images/logo/MIKE-IO-1D-Logo-Pos-RGB-nomargin.png)
# MIKE IO 1D: Read MIKE 1D in python

Read res1d and xns11 files.
Read, manipulate, and analyze res1d, res, resx, out, and xns11 files.

For other MIKE files (Dfs0, Dfs1, Dfs2, Dfsu,...) use the related package [MIKE IO](https://github.com/DHI/mikeio)

## Requirements
* Windows operating system (Support for Linux is experimental)
* Python x64 3.9, 3.10, 3.11 or 3.12
* [VC++ redistributables](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) (already installed if you have MIKE)
* Windows, Linux (experimental)
* Python x64 3.9 - 3.12
* (Windows) [VC++ redistributables](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) (already installed if you have MIKE)
* (Linux) [.NET Runtime](https://learn.microsoft.com/en-us/dotnet/core/install/linux) (not installed by default)

## Installation

From PyPI:

`pip install mikeio1d`

Linux users will need to install .NET runtime. For Ubuntu, you can install .NET runtime as follows:

`sudo apt install dotnet-runtime-7.0`

Or development version:

`pip install https://github.com/DHI/mikeio1d/archive/main.zip`

If you're on the development branch, you need .NET SDK. Ubuntu users can install these dependencies as follows:

For MIKE IO 1D to work .NET runtime environment (version 3.1 and above) is needed. On Linux operating systems this is not available per default. For example, on Ubuntu distribution to get .NET 7.0 runtime call:

`sudo apt install dotnet-runtime-7.0`
`sudo apt install dotnet-sdk-7.0`

## Where can I get help?
## Documentation

* New ideas and feature requests - [GitHub Discussions](http://github.com/DHI/mikeio1d/discussions)
* Bugs - [GitHub Issues](http://github.com/DHI/mikeio1d/issues)
* General help, FAQ - [Stackoverflow with the tag `mikeio`](https://stackoverflow.com/questions/tagged/mikeio1d)
Check out the [official documentation for MIKE IO 1D](https://dhi.github.io/mikeio1d/).

## Getting started

## Examples

### Read Res1D file Return Pandas DataFrame
### Read network results into a DataFrame
```python
>>> from mikeio1d.res1d import Res1D, QueryDataReach
>>> df = Res1D(filename).read()
>>> from mikeio1d import Res1D
>>> res = Res1D('my_results.res1d')
>>> df = res.read()

>>> query = QueryDataReach("WaterLevel", "104l1", 34.4131)
>>> df = res1d.read(query)
>>> df_reach = res.reaches['my_reach'].Discharge.read()
>>> df_node = res.nodes['my_node'].WaterLevel.read()
```
For more Res1D examples see this [notebook](https://nbviewer.jupyter.org/github/DHI/mikeio1d/blob/main/notebooks/Res1D.ipynb)

### Read Xns11 file and plot a cross section
```python
Expand All @@ -53,3 +54,11 @@ For more Res1D examples see this [notebook](https://nbviewer.jupyter.org/github/
>>> xns.xsections.['basin_right', '238.800', '1'].plot()
```
![Geometry](https://raw.githubusercontent.com/DHI/mikeio1d/main/images/xns11_geometry.png)

Continue learning with [additional examples](https://dhi.github.io/mikeio1d/examples/res1d_basic.html).

## Where can I get help?

* Reference - [Documentation](https://dhi.github.io/mikeio1d/)
* New ideas and feature requests - [GitHub Discussions](http://github.com/DHI/mikeio1d/discussions)
* Bugs - [GitHub Issues](http://github.com/DHI/mikeio1d/issues)
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.quarto/
/_site/
/api/
/_inv/
objects.json
Binary file added docs/MIKE-IO-Icon-Pos-RGB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/MIKE-IO-Logo-Pos-RGB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

7 changes: 7 additions & 0 deletions docs/_extensions/fontawesome/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Font Awesome support
author: Carlos Scheidegger
version: 1.1.0
quarto-required: ">=1.2.269"
contributes:
shortcodes:
- fontawesome.lua
Loading
Loading