|
| 1 | +# Contributions |
| 2 | + |
| 3 | +Thank you for considering contributing to the BlueMath package! We welcome contributions from the community and are grateful for your support. |
| 4 | + |
| 5 | +## How to Contribute |
| 6 | + |
| 7 | +### 1. Fork the Repository (skip if you are GeoOcean) |
| 8 | + |
| 9 | +Start by forking the repository to your GitHub account. This will create a copy of the repository under your GitHub account. |
| 10 | + |
| 11 | +### 2. Clone the Repository |
| 12 | + |
| 13 | +Clone the forked repository to your local machine using the following command: |
| 14 | + |
| 15 | +```sh |
| 16 | +git clone https://github.com/geoocean/BlueMath.git |
| 17 | +``` |
| 18 | + |
| 19 | +### 3. Create a branch |
| 20 | + |
| 21 | +Create a new branch for your contribution. Use a descriptive name for your branch: |
| 22 | + |
| 23 | +```sh |
| 24 | +git checkout -b feature/your-feature-name |
| 25 | +``` |
| 26 | + |
| 27 | +An example branch could be `feature/xbeach-wrapper`. |
| 28 | + |
| 29 | +### 4. Make changes |
| 30 | + |
| 31 | +Make the necessary changes to the codebase. Ensure that your code follows the project's coding standards and guidelines. |
| 32 | + |
| 33 | +### 5. Commit changes |
| 34 | + |
| 35 | +```sh |
| 36 | +git add . |
| 37 | +git commit -m "Add your commit message here" |
| 38 | +``` |
| 39 | + |
| 40 | +### 6. Push changes |
| 41 | + |
| 42 | +Push your changes to your forked repository (Remember repo is not forked if your GeoOcean): |
| 43 | + |
| 44 | +```sh |
| 45 | +git push origin feature/your-feature-name |
| 46 | +``` |
| 47 | + |
| 48 | +### 7. Create a Pull Request |
| 49 | + |
| 50 | +Go to the original repository on GitHub and create a pull request from your forked repository. Provide a clear and detailed description of your changes and the problem they solve. |
| 51 | + |
| 52 | +### 8. Review Process |
| 53 | + |
| 54 | +Your pull request will be reviewed by the maintainers. Please be responsive to any feedback or questions they may have. Once your pull request is approved, it will be merged into the main branch. |
| 55 | + |
| 56 | +### 9. Reporting Issues |
| 57 | + |
| 58 | +If you encounter any issues or bugs, please report them by creating a new issue on the GitHub repository. Provide as much detail as possible to help us understand and resolve the issue. |
| 59 | + |
| 60 | +### 10. Code of Conduct |
| 61 | + |
| 62 | +Please adhere to our Code of Conduct to ensure a welcoming and inclusive environment for everyone. |
| 63 | + |
| 64 | +### 11. License |
| 65 | + |
| 66 | +By contributing to the BlueMath package, you agree that your contributions will be licensed under the MIT License. |
| 67 | + |
| 68 | +### 12. Contact |
| 69 | + |
| 70 | +If you have any questions or need further assistance, feel free to reach out to the maintainers. |
| 71 | + |
| 72 | +Thank you for your contributions and support! |
| 73 | + |
| 74 | +## Documentation |
| 75 | + |
| 76 | +When creating new `python` code, it is essential to properly document all new classes and functions. Below, we show how the **docstrings** of classes should look, so the community can properly learn how to use **BlueMath**. |
| 77 | + |
| 78 | +Code example: |
| 79 | +```python |
| 80 | +import numpy as np |
| 81 | + |
| 82 | +class HyWavesExample: |
| 83 | + """ |
| 84 | + This class implements a HyWaves Metamodel Example for nearshore wave propagations. |
| 85 | +
|
| 86 | + Attributes |
| 87 | + ---------- |
| 88 | + waves_model : str |
| 89 | + The waves numerical model to use. |
| 90 | + statistical_model : str, optional |
| 91 | + The statistical model to use. Default is "MDA". |
| 92 | +
|
| 93 | + Methods |
| 94 | + ------- |
| 95 | + run_model -> np.ndarray |
| 96 | + Runs the waves numerical model and returns the output. |
| 97 | + """ |
| 98 | + |
| 99 | + def __init__(self, waves_model: str, statistical_model: str = "MDA") -> None: |
| 100 | + self.waves_model = waves_model |
| 101 | + self.statistical_model = statistical_model |
| 102 | + |
| 103 | + def run_model(self, launcher: str) -> np.ndarray: |
| 104 | + """ |
| 105 | + Runs the numerical waves model. |
| 106 | +
|
| 107 | + Parameters |
| 108 | + ---------- |
| 109 | + launcher : str |
| 110 | + The launcher to use. |
| 111 | + """ |
| 112 | + |
| 113 | + self.run_model(launcher=launcher, model=self.waves_model) |
| 114 | + return self.get_model_ouput() |
| 115 | +``` |
0 commit comments