Open Sustainable Technology

A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Browse accepted projects | Review proposed projects | Propose new project | Open Issues

D-EcoImpact

A Python based kernel to perform spatialenvironmental impact assessment.
https://github.com/deltares/d-ecoimpact

ecological-modelling environmental-modeling environmental-modelling

Last synced: about 23 hours ago
JSON representation

Repository metadata

A Python based kernel to perform spatial (environmental) impact assessment

README

        

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![TeamCity build status](https://dpcbuild.deltares.nl/app/rest/builds/buildType:id:DEcoImpact_UnitTests/statusIcon.svg)](https://dpcbuild.deltares.nl/viewType.html?buildTypeId=DEcoImpact_UnitTests)

# D-EcoImpact

A Python based kernel to perform spatial (environmental) impact assessment. Based on knowledge rules applied to model output and/or measurements.
The dependencies of the D-EcoImpact are declared, managed and installed with [Poetry](https://python-poetry.org/).

## Copyright
Copyright © 2022-2023 Stichting Deltares

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License version 3.0 as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

A copy of the GNU General Public License can be found at

and at

Contact: [email protected]
Stichting Deltares
P.O. Box 177
2600 MH Delft, The Netherlands

All indications and logos of, and references to registered trademarks
of Stichting Deltares remain the property of Stichting Deltares. All
rights reserved.

## Prerequisites

- python 3.9 or higher
- poetry 1.3 or higher we recommend: ([installation instructions](https://python-poetry.org/docs/#installation))

If you prefer to install poetry with conda then we recommed to install poetry only to the base environment:

```sh
$ conda install -y -c conda-forge poetry
```

## Install

To install the dependencies of the project create a virtual environment either with `venv` or `conda`.\
Switch to this environment and use `poetry` to restore the package dependencies.

### Create environment

> Whereby **** stands for your chosen environment name.
>
> The name can not contain any spaces or special characters.

#### Anaconda or Miniconda:

- Create `conda` environment
```sh
$ conda create -y -c pip --name python=3.11
```
- Activate `conda` environment
```sh
$ conda activate
```

### venv:

- Create `venv` virtual environment

```sh
$ python -m venv
```

- Activate `venv` environment
```
$ .\env\Scripts\activate
```

(see
[Documentation](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment))

### Add dependencies

```sh
$ poetry install
```

## Run

Make sure you have a correct input file available in the main folder (eg. input_file.yaml) and use this as the first keyword argument when running the code through command line:

```sh
$ python main.py input_file.yaml
```

## Development

When adding a new dependency, do so using `poetry`

- Add a new dependency

```sh
$ poetry add
```

- Add a new dependency for development
```sh
$ poetry add --dev
```

### Versioning
The version looks like this: major.minor.patch
- The repository depends on automatic versioning through github actions. For each commit, the patch version will be increased in the
pyproject.toml.
- The major and minor version will only be updated by a manual trigger through github actions (triggering the 'release.yaml') in which case a tag will be created.

## Documentation

There are mkdocs available for documentation on how to use this code.
For now these are available offline by running the command:

```
$ mkdocs serve
```

The pages will be served locally and available on one of you local ports. When executing this command in the INFO messages the location will be shown where the docs are available:

```
INFO - [10:44:34] Serving on http://127.0.0.1:8000/
```

In this case the docs are available on http://127.0.0.1:8000/ or http://localhost:8000

For each release a version of documentation is available at:
[deltares.github.io/D-EcoImpact/](deltares.github.io/D-EcoImpact/)

## Add acceptance tests

To add an acceptance test:

- Create the [name].yaml file and store it in the tests_acceptance/input_yaml_files
- Put the [name].nc at the tests_acceptance/reference_nc_files folder. \* Note that the .nc file should have the same name as the .yaml file.
- To test if it is working correctly run: poetry run pytest tests_acceptance/test_main.py

## Docker image

### Build
To build the docker image, run the following command in the root of the project:

```sh

$ ./build-image.sh

```

### Pull

To pull the docker image from the docker hub, run the following command:

```sh

$ docker pull ghcr.io/deltares/d-ecoimpact:latest

```

### Authentication with GitHub Container Registry
Before building your Docker image, ensure you're authenticated with GHCR to allow pulling private images. Use the
docker login command with your GitHub username and a Personal Access Token (PAT) that has the appropriate scopes
(read:packages at a minimum).

```bash
echo "YOUR_PERSONAL_ACCESS_TOKEN" | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
```


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 571
Total Committers: 16
Avg Commits per committer: 35.688
Development Distribution Score (DDS): 0.792

Commits in past year: 364
Committers in past year: 13
Avg Commits per committer in past year: 28.0
Development Distribution Score (DDS) in past year: 0.764

Name Email Commits
mKlapwijk m****k@d****l 119
CindyvdVries c****s@g****m 108
Hidde Elzinga H****a@D****l 74
IoannaMi i****a@h****m 68
Wouter w****d@g****m 64
Wouter w****d@d****l 51
github-actions g****s@g****m 32
Wouter Schoonveld 3****d 15
Marc Weeber 4****r 12
David Rodriguez Aguilera 3****g 10
Hidde Elzinga H****a@d****l 6
Mostafa Farrag m****g@g****m 3
HiddeElzinga 6****a 3
mKlapwijk 4****k 3
IoannaMi 5****i 2
Qinghua_ye 1****s 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 0
Total pull requests: 103
Average time to close issues: N/A
Average time to close pull requests: 3 days
Total issue authors: 0
Total pull request authors: 9
Average comments per issue: 0
Average comments per pull request: 0.09
Merged pull request: 92
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 75
Past year average time to close issues: N/A
Past year average time to close pull requests: 3 days
Past year issue authors: 0
Past year pull request authors: 8
Past year average comments per issue: 0
Past year average comments per pull request: 0.08
Past year merged pull request: 65
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/deltares/d-ecoimpact

Top Issue Authors

Top Pull Request Authors

  • wschoonveld (30)
  • CindyvdVries (28)
  • mKlapwijk (17)
  • IoannaMi (16)
  • HiddeElzinga (5)
  • Davidrag (4)
  • MPWeeber (1)
  • ye4deltares (1)
  • MAfarrag (1)

Top Issue Labels

Top Pull Request Labels

Score: 4.564348191467836