Metadata-Version: 2.1
Name: mikeio1d
Version: 0.7.0
Summary: A package that uses the DHI MIKE1D .NET libraries to read res1d and xns11 files.
Home-page: https://github.com/DHI/mikeio1d
Author: Gediminas Kirsanskas
Author-email: geki@dhigroup.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pythonnet >=3.0.0
Requires-Dist: numpy
Requires-Dist: pandas >=2.1.0
Requires-Dist: mikecore ; platform_system == "Linux"
Provides-Extra: all
Requires-Dist: matplotlib ; extra == 'all'
Requires-Dist: geopandas ; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: black ; extra == 'dev'
Requires-Dist: matplotlib ; extra == 'dev'
Requires-Dist: jupyterlab ; extra == 'dev'
Requires-Dist: geopandas ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
Requires-Dist: sphinx-autobuild ; extra == 'docs'
Requires-Dist: sphinx-copybutton ; extra == 'docs'
Requires-Dist: myst-parser ; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: matplotlib ; extra == 'test'
Requires-Dist: pyarrow ; extra == 'test'
Requires-Dist: nbformat ; extra == 'test'
Requires-Dist: nbconvert ; extra == 'test'
Requires-Dist: ipykernel ; extra == 'test'

![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.

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)

## Installation

From PyPI: 

`pip install mikeio1d`

Or development version:

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


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`

## Where can I get help?

* 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)


## Examples

### Read Res1D file Return Pandas DataFrame
```python
>>>  from mikeio1d.res1d import Res1D, QueryDataReach
>>>  df = Res1D(filename).read()

>>>  query = QueryDataReach("WaterLevel", "104l1", 34.4131)
>>>  df = res1d.read(query)
```
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
>>>  from mikeio1d import Xns11

# Plot section with location id 'basin_right', chainage '238.800', and topo id '1'.
>>>  xns = Xns11("mikep_cs_demo.xns11")
>>>  xns.xsections.['basin_right', '238.800', '1'].plot()
```
![Geometry](https://raw.githubusercontent.com/DHI/mikeio1d/main/images/xns11_geometry.png)
