-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Dev Guide | ||
========= | ||
|
||
Contributions to ramannoodle - in the form of bug reports, feature suggestions, pull requests, etc. - are always welcome! We are particularly interested in adding new interfaces for first-principles codes as well as new polarizability models. This document provides a few development guidelines. Please reach out on Github with any questions or if you want to collaborate :) | ||
|
||
Workflow | ||
-------- | ||
|
||
Ramannoodle is hosted on Github: | ||
|
||
`https://github.com/wolearyc/ramannoodle <https://github.com/wolearyc/ramannoodle>`_ | ||
|
||
The project uses `pre-commit <https://pre-commit.com/>`_ with a range of hooks that help ensure high code quality and consistency. You are strongly encouraged to use it frequently, as all pull requests need to pass CI pre-commit before merge! Pre-commit can be installed with pip | ||
|
||
.. code-block:: console | ||
$ pip install pre-commit | ||
and can be run from the repository's root directory with | ||
|
||
.. code-block:: console | ||
$ pre-commit run --all | ||
Ramannoodle includes a test suite that uses the `pytest <https://docs.pytest.org/en/stable/>`_ framework. Pull requests must pass all CI tests in order to be merged. New tests should be developed for any new functionality. | ||
|
||
Ramannoodle's documentation is built with `Sphinx <https://www.sphinx-doc.org/en/master/>`_. The documentation can be built by running | ||
|
||
.. code-block:: console | ||
$ make html | ||
in the docs directory. The resulting html is available in build/html. | ||
|
||
Guidelines | ||
---------- | ||
|
||
In no particular order, here are some guidelines that are followed throughout ramannoodle: | ||
|
||
* Since `mypy <https://mypy-lang.org/>`_ is used, type hints are mandatory. | ||
|
||
* Whenever possible, use the EAFP (as opposed to LBYL) principle when raising exceptions. | ||
|
||
* Use numpy-style docstrings. | ||
|
||
* All public-facing functions should raise descriptive TypeError and ValueError exceptions when invalid arguments are provided. These sorts of exceptions should not be documented in the docstring. | ||
|
||
* All array arguments should be numpy arrays. This should be enforced, when appropriate, through exceptions. | ||
|
||
* Docstring descriptions for array arguments should provide a dimension and shape. Uppercase letters can be used for cases where shape is variable. For example, "4D array with shape (M,N,3) where M is ... and N is ...". | ||
|
||
* Unless otherwise noted, fractional coordinates are always used. Variables for cartesian coordinates always have "cartesian\_" appended. | ||
|
||
* Use classes widely. Sometimes, a regular function is all that is needed! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters