Skip to main content

Python package for the threedigrid administration

Project description

===========
threedigrid
===========



.. image:: https://travis-ci.org/nens/threedigrid.svg?branch=master
:target: https://travis-ci.org/larsclaussen/threedigrid


.. image:: https://readthedocs.org/projects/threedigrid/badge/?version=latest
:target: https://threedigrid.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status



Python package for the threedigrid administration.


* Free software: BSD license
* Documentation: https://threedigrid.readthedocs.io.


Features
========
- access to the threedicore administration by a single instance of the ``GridH5Admin`` object
- query the model data by pre-defined subsets and django style filters
- export model data to gis formats like shapefile, geopackage
- serialize model data as geojson


Installation
============

Using pip::

$ pip install threedigrid

To be able to use the full range of features you need to install the python gdal bindings.
There are several ways to accomplish this, see the following thread for an overview:

https://gis.stackexchange.com/questions/9553/installing-gdal-and-ogr-for-python


Quick start
===========

Get a grid admin instance::

from threedigrid import GridH5Admin

f = 'gridadmin.h5'
ga = GridH5Admin(f)


The grid admin directly holds some model specific attributes like whether the model has a 1D or 2D
or groundwater section::

In [4]: ga.has_groundwater
Out[4]: False

In [5]: ga.has_1d
Out[5]: True


Filtering
---------

There are different types of filters but a filter, generally speaking, acts on field. That means you can
filter by value. If you have a line model instance you can filter the data by the kcu field::

ga.lines.filter(kcu__in=[100,102])

or by the lik value::

ga.lines.filter(lik__eq=4)

The filtering is lazy, that is, to retrieve data you have to call data explicitly::

ga.lines.filter(lik__eq=4).data # will return an ordered dict



Tests
=====

Tests can be run best in a docker container::

$ cd <project_root>
$ docker build -t threedigrid:test .
$ docker run --rm threedigrid:test pytest --cov=threedigrid --flake8



Credits
=======

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.2 (2018-03-12)
------------------

- Get model extent now always returns a bbox (minX, minY, maxX, maxY)

0.1.1 (2018-03-06)
------------------

- All imports are absolute.

- Added install info using pip.


0.1.0 (2018-03-05)
------------------

* First release with fullrelease.


Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threedigrid-0.1.2.tar.gz (903.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threedigrid-0.1.2-py2.py3-none-any.whl (62.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file threedigrid-0.1.2.tar.gz.

File metadata

  • Download URL: threedigrid-0.1.2.tar.gz
  • Upload date:
  • Size: 903.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for threedigrid-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b6658c9103f0e1eff688324dcd1fa24d527a8b872886f60f3306fbe5d0234a8
MD5 1b97242353e1e5d1f08f23c0b6fc26bd
BLAKE2b-256 9bc0d8bcb8605a6cd498e12b4111593a4ed1907b9b70b42ac1505ca992792c5c

See more details on using hashes here.

File details

Details for the file threedigrid-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for threedigrid-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 97ba372400cb9fb067f760ae629ad03c161808481e935490f70a3d7a39d27d0a
MD5 c167bfcf8bb8777c9af63551344601bb
BLAKE2b-256 07e16425a9011b61630bd3bb91f4c420a44417a2eabe9a9af92c09fba1ed6e6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page