|
1 | | -# Contributing guidelines |
| 1 | +# STEMMUS_SCOPE processing |
2 | 2 |
|
3 | | -We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). |
| 3 | +This document illustrates how to run the model STEMMUS_SCOPE as a developer. |
| 4 | +The workflow is executed using python and MATLAB on a Unix-like system where a MATLAB license is available. |
| 5 | +To run the STEMMUS_SCOPE, you need MATLAB version `>=2019`. |
4 | 6 |
|
5 | | -A contribution can be one of the following cases: |
| 7 | +The python packages are listed in the |
| 8 | +[`environment.yml`](https://github.com/EcoExtreML/processing/blob/main/environment.yml) |
| 9 | +file. Follow the instructions below to create conda environment. |
6 | 10 |
|
7 | | -1. you have a question; |
8 | | -1. you think you may have found a bug (including unexpected behavior); |
9 | | -1. you want to make some kind of change to the code base (e.g. to fix a bug, to add a new feature, to update documentation); |
10 | | -1. you want to make a new release of the code base. |
| 11 | +<details> |
| 12 | + <summary>Create conda environment </summary> |
11 | 13 |
|
12 | | -The sections below outline the steps in each case. |
| 14 | +Run the commands below in a terminal: |
13 | 15 |
|
14 | | -## You have a question |
| 16 | +```sh |
| 17 | +# Download and install Conda |
| 18 | +wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pypy3-Linux-x86_64.sh |
| 19 | +bash Mambaforge-pypy3-Linux-x86_64.sh |
| 20 | +-b -p ~/mamba |
15 | 21 |
|
16 | | -1. use the search functionality [here](https://github.com/EcoExtreML/stemmus_scope_processing/issues) to see if someone already filed the same issue; |
17 | | -2. if your issue search did not yield any relevant results, make a new issue; |
18 | | -3. apply the "Question" label; apply other labels when relevant. |
| 22 | +# Update base environment |
| 23 | +. ~/mamba/bin/activate |
| 24 | +mamba update --name base mamba |
19 | 25 |
|
20 | | -## You think you may have found a bug |
| 26 | +# Clone this repository |
| 27 | +git clone https://github.com/EcoExtreML/processing.git |
21 | 28 |
|
22 | | -1. use the search functionality [here](https://github.com/EcoExtreML/stemmus_scope_processing/issues) to see if someone already filed the same issue; |
23 | | -1. if your issue search did not yield any relevant results, make a new issue, making sure to provide enough information to the rest of the community to understand the cause and context of the problem. Depending on the issue, you may want to include: |
24 | | - - the [SHA hashcode](https://help.github.com/articles/autolinked-references-and-urls/#commit-shas) of the commit that is causing your problem; |
25 | | - - some identifying information (name and version number) for dependencies you're using; |
26 | | - - information about the operating system; |
27 | | -1. apply relevant labels to the newly created issue. |
| 29 | +# Create a conda environment called 'stemmus' with all required dependencies |
| 30 | +cd processing |
| 31 | +mamba env create |
28 | 32 |
|
29 | | -## You want to make some kind of change to the code base |
| 33 | +# The environment can be activated with |
| 34 | +. ~/mamba/bin/activate stemmus |
30 | 35 |
|
31 | | -1. (**important**) announce your plan to the rest of the community *before you start working*. This announcement should be in the form of a (new) issue; |
32 | | -1. (**important**) wait until some kind of consensus is reached about your idea being a good idea; |
33 | | -1. if needed, fork the repository to your own Github profile and create your own feature branch off of the latest master commit. While working on your feature branch, make sure to stay up to date with the master branch by pulling in changes, possibly from the 'upstream' repository (follow the instructions [here](https://help.github.com/articles/configuring-a-remote-for-a-fork/) and [here](https://help.github.com/articles/syncing-a-fork/)); |
34 | | -1. make sure the existing tests still work by running ``pytest``; |
35 | | -1. add your own tests (if necessary); |
36 | | -1. update or expand the documentation; |
37 | | -1. update the `CHANGELOG.md` file with change; |
38 | | -1. push your feature branch to (your fork of) the PyStemmusScope repository on GitHub; |
39 | | -1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/). |
| 36 | +``` |
| 37 | +</details> |
40 | 38 |
|
41 | | -In case you feel like you've made a valuable contribution, but you don't know how to write or run tests for it, or how to generate the documentation: don't let this discourage you from making the pull request; we can help you! Just go ahead and submit the pull request, but keep in mind that you might be asked to append additional commits to your pull request. |
| 39 | + |
| 40 | +# Run model in a Jupyter notebook |
| 41 | + |
| 42 | +**On Snellius:** |
| 43 | + |
| 44 | +[Snellius](https://servicedesk.surfsara.nl/wiki/display/WIKI/Snellius) is the |
| 45 | +Dutch National supercomputer hosted at SURF. |
| 46 | + |
| 47 | +The notebook [run_model_in_notebook_dev.ipynb](./notebooks/run_model_in_notebook_dev.ipynb) shows how to run the model. |
| 48 | +Use the script |
| 49 | +[`run_jupyter_lab_snellius_dev.sh`](https://github.com/EcoExtreML/processing/blob/main/run_jupyter_lab_snellius_dev.sh) |
| 50 | +to create a Jupyter lab server on Snellius for running the notebook |
| 51 | +interactively. |
| 52 | + |
| 53 | +# Run model in a MATLAB script |
| 54 | + |
| 55 | +**On CRIB:** |
| 56 | + |
| 57 | +[CRIB](https://crib.utwente.nl/) is the ITC Geospatial Computing Platform. |
| 58 | + |
| 59 | +1. Log in CRIB with your username and password and select a proper compute unit. |
| 60 | +2. Check `config_file_crib.txt` and change the paths if needed, specifically |
| 61 | + "InputPath" and "OutputPath". |
| 62 | +3. click on the `Remote Desktop` in the |
| 63 | +Launcher. Click on the `Applications`. You will find the 'MATLAB' software under |
| 64 | +the `Research`. |
| 65 | +4. After clicking on 'MATLAB', it asks for your account information that is |
| 66 | +connected to a MATLAB license. |
| 67 | +5. Open the file `run_model_in_matlab_dev.m` and set the paths inside the script. |
| 68 | +6. Then, run the main script `run_model_in_matlab_dev.m`. |
| 69 | + |
| 70 | +# Recipe of model execution |
| 71 | + |
| 72 | +The execution of the model includes following steps: |
| 73 | + |
| 74 | +- Update/set config files |
| 75 | +- Create input directories, prepare input files |
| 76 | +- Run the model |
| 77 | +- Create output directories, prepare output files |
| 78 | +- Create exe file |
0 commit comments