Package: delft3dfmpy
Python package to generate delft3dfm models from standardized data models or other flow models.Free software: MIT licenseWIKI (in Dutch):https://hkvconfluence.atlassian.net/wiki/spaces/DHYD/pages/222396421/AchtergrondFeaturesRead Hydamo or shape files to Python data structureBuild Delft3D FM model from Hydamo or seperately defined elementsGenerate rectangular meshes with refinementCreate 1D 2D connectionsCreate RR model schematisationWrite to Delft3D FM modelInstallationThe packagedelft3dfmpyrequires you to have (a) an environment with required dependencies and (b) an Integrated Development Envrionment (IDE) that can access this envrionment.Please meet these two conditions first with instructions below before installing the Python packagedelft3dfmpy.Environment PreparationPrepare an environment with the correct dependencies fordelft3dfmpy.Install a Anaconda or Minoconda Python distribution:https://www.anaconda.com/products/individualhttps://docs.conda.io/en/latest/miniconda.htmlSave the content ofhttps://raw.githubusercontent.com/openearth/delft3dfmpy/master/environment.ymland store this in a local file namedenvironment.ymlOpen Ananconda prompt and enter the directory where theenvrionment.ymlfrom step 2 is stored.Install thedelft3dfmpyenvironment with the required modules, by executing the following command in the opened command prompt.conda env create-fenvironment.ymlThis should create adelft3dfmpyenvironment with the required dependencies.Activate the created environment by the following command in command prompt:conda activate delft3dfmpyYou now have a correct and activated environment for installation of thedelft3dfmpyPython packagePython packagedelft3dfmpyInstall the Python packagedelft3dfmpydirectly, by executing the following command in an Anaconda Promptpython-mpip install delft3dfmpyNote that in this way the most recent version that is available on PyPi (see releases) is installed. From June 2022, and version 2.0.1, delft3dfmpy expects DAMO2.2 GPKG files as input, instead of HyDAMO v13 GML-files.It is also possible to force installation of older versions and use the idential packages for GML input. The equivalent version ofdelft3dfmpyfor HyDAMO v13 format is v1.2.3. This can be installed as follows:python-mpip install delft3dfmpy=1.2.3If the command prompt statesSuccessfully built delft3dfmpythen installation is succesful.Envrionment Integration in your IDEIntegration of the prepared environment depends on the IDE of usage. Here we mention briefly some options for the user (pick one!):For a new instance of Jupyter within the activated environment:Using Notebookconda install-cconda-forgenotebookor using JupyterLabconda install-cconda-forgejupyterlabTo register the newly created environment as a new kernel for Jupyter (Notebook or JupyterLab):python-mipykernel install--user--name=delft3dfmpyNo extra actions are required for PyCharm, Spyder or VSCode + Python extension.UsageActivate the created environment in an (Anaconda) command prompt (conda activate delft3dfmpy) before running your notebook or script. A Jupyter notebook or command prompt for the environment can also be launched from the Anaconda Navigator.
For more information on how to use environments, see:https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.htmlThe usage is best described by the example notebook:https://github.com/openearth/delft3dfmpy/blob/master/notebooks/Usage_introduction_coupled_RRFM.ipynbContributionContributions are much welcome for documentation, desirable features and bugs. The code and development happens in this GitHub repository:https://github.com/openearth/delft3dfmpy.For contributions, use the following guidelines:Fork the project on GitHub and clone the fork to your Operating System.Make sure you have installed and activated the environment as is described above.Delft3dfmpy usesflitto to build, package and publish the project. To install the development dependencies and register the cloned fork as a Python package for development purposes do the following:From an elevated Anaconda Prompt (run as Administrator) within the activateddelft3dfmpyenvironment:conda install-cconda-forgeflitflit install--depsdevelop--symlinkThis installs the development dependencies and creates a symbolic link in the Python site-packages folder of the activated environment.Open the repository as folder/workspace in your favorite IDE (eg. VSCode + Python extension)Make your contributions and test the changes locally.Once satisfied, push your changes as a new branch to your fork and create a Pull Request to the original repository.A maintainer on the main GitHub repository will review your PR and guide the merging process.