Skip to content

Commit

Permalink
Merge branch 'ogs653' into 'main'
Browse files Browse the repository at this point in the history
Prepare 0.4.0 release

See merge request ogs/tools/ogstools!202
  • Loading branch information
TobiasMeisel committed Sep 6, 2024
2 parents e1070b1 + 8c21e21 commit d311aa8
Show file tree
Hide file tree
Showing 9 changed files with 380 additions and 247 deletions.
1 change: 1 addition & 0 deletions docs/releases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
maxdepth: 3
---
0.x (upcoming release) <ogstools-0.x>
0.4.0 <ogstools-0.4.0>
0.3.1 <ogstools-0.3.1>
0.3.0 <ogstools-0.3.0>
0.2.0 <ogstools-0.2.0>
Expand Down
138 changes: 138 additions & 0 deletions docs/releases/ogstools-0.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# OGSTools 0.4.0 Release Notes

## Overview

Supports Python: 3.10, 3.11, 3.12.

First release after integration of ogs6py. The state of ogs6py corresponds to the functionality of [v.403 of ogs6py](https://github.com/joergbuchwald/ogs6py/releases/tag/v.403) (only light API changes, see Features/Project file)

## OGS

[OpenGeoSys](https://www.opengeosys.org/) version: 6.5.3

## Migration strategy from ogs6py to ogstools

The recommended strategy is:

- Back up your environment with `pip freeze > yourfile.txt`
- Upgrade ogs6py to 0.403 first and resolve issues (see breaking changes).
- Uninstall ogs6py and install ogstools
- Remove `import ogs6py`. Add `import ogstools as ogs`. The former `OGS` becomes `Project` and function parameters of `OGS.__init__()` are now with lower case names. See example in Features

## API changes

### plot

- renamed meshplotlib to plot
- renamed plot function to contourf
- renamed setup.p_min -> setup.vmin, setup.p_max -> setup.vmax
- added several setup options available as kwargs

### variables

- renamed propertylib to variables (to align with OpenGeoSys vocabulary)
- presets are now directly accessible as variables
- renamed presets to properties
- renamed Property class to Variable

## meshlib

- renamed aggregate function to time_aggregate
- renamed MeshSeries.read to MeshSeries.mesh

## Features

### ogs6py

- new version with significant parts of the codebase rewritten. Changes visible to the user:

#### example

before:

```python
import ogstools as ogs

prj = ogs.Project(input_file="mechanics.prj", output_file="old_parameter_add.prj")
prj.add_block(
blocktag="parameter",
parent_xpath="./parameters",
taglist=["name", "type", "value"],
textlist=["density", "Constant", "1900"],
)
prj.write_input()
```

now:

```python
import ogstools as ogs

prj = ogs.Project(input_file="mechanics.prj", output_file="new_parameter_add.prj")
prj.parameters.add_parameter(name="density", type="Constant", value="1900")
prj.write_input()
```

- support for combining replacement- and build-method commands
- breaking changes: some methods renamed closer to project file tags:

* `add_process_variable()` split-up into `add_secondary_variable()` and `add_process_variable()`
* `geo.add_geom()` -> `geometry.add_geometry()`, `timeloop` -> `time_loop` etc.

- support for more MPL properties
- several bugfixes and tiny new features
- ## integration into ogstools

### plot

- Time slice plots can be created easily: filled contour plots of transient data along a sampling line ([example](https://ogs.ogs.xyz/tools/ogstools/auto_examples/howto_plot/plot_timeslice.html#))

![time_slice](https://ogs.ogs.xyz/tools/ogstools/_images/sphx_glr_plot_timeslice_001.png)

- Variables now have default symbols (e.g. used for labels in plots)

### Mesh and MeshSeries

- Mesh can be created from a shapefile

```
mesh = ogs.Mesh.read(test_shapefile)
```

- Mesh can be remeshed with triangle
![Mesh_triangle](https://ogs.ogs.xyz/tools/ogstools/_images/sphx_glr_plot_remeshing_002.png)
- MeshSeries has a performant algorithm for integration point tessellation called `MeshSeries.ip_tesselated()` - [example for analyzing integration point data](https://ogs.ogs.xyz/tools/ogstools/auto_examples/howto_postprocessing/plot_ipdata.html#sphx-glr-auto-examples-howto-postprocessing-plot-ipdata-py)
- MeshSeries allows multidimensional indexing on ndarrays <https://numpy.org/doc/stable/user/basics.indexing.html>

```python
import ogstools as ogs

ms = ogs.MeshSeries("filepath/filename_pvd_or_xdmf")
ms.data("darcy_velocity")[-2:, 1:4, :] # shape is(2, 3, 2)
result_mesh = ms[-1]
for mesh in ms:
print(mesh)
```

- Added function argument to Meshseries.animate functions has more flexible parameter that allow
1. transformation of the mesh and
1. customization of the plot
- Meshseries has domain_aggregate function (e.g. min/max of a variable per time step)

### Project files

- ogs6py added (this version corresponds to https://github.com/joergbuchwald/ogs6py/releases/tag/v.403)
- OGS class is renamed to Project
- Function parameters are with now lower case letters
- `project_file` is now `output_file`

### Documentation, examples and more

- Documentation got new structure of examples (now all organized under ogstools/examples/)
- pip requirements.txt files (of tested environment) are added for stable test environment reproduction (To be used by developers. Do not use it in your projects!)

## Bugfixes

- Several small fixes in plotting functions (visual)
- MeshSeries closes file handle to h5 file after reading is finished
- Dependency compatibility (e.g., remove restriction to matplotlib and relaxing requirements)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"Pint>=0.22",
"papermill>=2.4.0",
"pandamesh>=0.2.1", # meshing algorithm changed with this version
"ogs>=6.5.2",
"ogs>=6.5.3",
"typeguard>=4.0.0",
"lxml>=4.6.0"
]
Expand Down
81 changes: 40 additions & 41 deletions requirements/requirements_allextras_py3_10.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
aiohttp==3.9.5
aiohappyeyeballs==2.4.0
aiohttp==3.10.5
aiosignal==1.3.1
ansicolors==1.1.8
anyio==4.4.0
Expand All @@ -8,27 +9,27 @@ argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.2.0
attrs==24.2.0
beautifulsoup4==4.12.3
black==24.4.2
black==24.8.0
bleach==6.1.0
build==1.2.1
certifi==2024.7.4
cffi==1.16.0
certifi==2024.8.30
cffi==1.17.1
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
cmocean==4.0.3
colorcet==3.1.0
comm==0.2.2
contourpy==1.2.1
contourpy==1.3.0
cycler==0.12.1
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.8
entrypoints==0.4
exceptiongroup==1.2.2
executing==2.0.1
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.15.4
flexcache==0.3
Expand All @@ -40,10 +41,10 @@ geopandas==1.0.1
gmsh==4.13.1
h5py==3.11.0
identify==2.6.0
idna==3.7
imageio==2.34.2
ipython==8.26.0
ipywidgets==8.1.3
idna==3.8
imageio==2.35.1
ipython==8.27.0
ipywidgets==8.1.5
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
Expand All @@ -54,22 +55,22 @@ jupyter-events==0.10.0
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_proxy==4.3.0
jupyter_server_proxy==4.4.0
jupyter_server_terminals==0.5.3
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.11
jupytext==1.16.3
kiwisolver==1.4.5
lxml==5.2.2
jupyterlab_widgets==3.0.13
jupytext==1.16.4
kiwisolver==1.4.7
lxml==5.3.0
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.1
matplotlib==3.9.2
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.1
mdurl==0.1.2
meshio==5.3.5
mistune==3.0.2
more-itertools==10.3.0
more-itertools==10.5.0
msgpack==1.0.8
multidict==6.0.5
mypy-extensions==1.0.0
Expand All @@ -78,12 +79,11 @@ nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
nodeenv==1.9.1
numpy==2.0.1
ogs==6.5.2
ogs6py==0.402
numpy==2.0.2
ogs==6.5.3
overrides==7.7.0
packaging==24.1
pandamesh==0.1.6
pandamesh==0.2.1
pandas==2.2.2
pandocfilters==1.5.1
papermill==2.6.0
Expand All @@ -102,56 +102,55 @@ pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
pyogrio==0.9.0
pyparsing==3.1.2
pyparsing==3.1.4
pyproj==3.6.1
pyproject_hooks==1.1.0
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.1
pyvista==0.44.1
PyYAML==6.0.1
pyzmq==26.0.3
PyYAML==6.0.2
pyzmq==26.2.0
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.7.1
rpds-py==0.19.1
scipy==1.14.0
rich==13.8.0
rpds-py==0.20.0
scipy==1.14.1
scooby==0.10.0
Send2Trash==1.8.3
shapely==2.0.5
shapely==2.0.6
simpervisor==1.0.0
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
soupsieve==2.6
stack-data==0.6.3
tenacity==9.0.0
terminado==0.18.1
tinycss2==1.3.0
tomli==2.0.1
tornado==6.4.1
tqdm==4.66.4
tqdm==4.66.5
traitlets==5.14.3
trame==3.6.3
trame-client==3.2.1
trame-server==3.0.3
trame-vtk==2.8.9
trame-vuetify==2.6.2
trame-client==3.2.5
trame-server==3.1.2
trame-vtk==2.8.10
trame-vuetify==2.7.1
triangle==20230923
typeguard==4.3.0
types-python-dateutil==2.9.0.20240316
types-python-dateutil==2.9.0.20240906
typing_extensions==4.12.2
tzdata==2024.1
uri-template==1.3.0
urllib3==2.2.2
virtualenv==20.26.3
vtk==9.3.1
VTUinterface==0.704
wcwidth==0.2.13
webcolors==24.6.0
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.11
wslink==2.1.1
yarl==1.9.4
widgetsnbextension==4.0.13
wslink==2.1.2
yarl==1.9.11
Loading

0 comments on commit d311aa8

Please sign in to comment.