How to Contribute ================= Contributions to THzTools are welcome! Here are some ways you can contribute: * Create a `discussion topic `_ if you have an idea for a new feature or a general topic for discussion. * Create an `issue `_ if you find a bug with THzTools, an issue with its documentation, or have a suggestion for improving the package. New feature requests are also welcome! * If you would like to make improvements to the source code or documentation then you may do so directly by opening a `pull request `_. Please review the following section for details about the development process. Please review our `code of conduct `_ and follow the guidelines described there to help us maintain clear and respectful communication. Development Process ------------------- Please review the `Contributing to a project `_ instructions on GitHub if you would like to contribute to the THzTools code base and documentation. Development Tools ----------------- THzTools development relies on the following tools: - Unit tests: `pytest `_ - Code coverage: `coverage `_ - Documentation builder: `Sphinx `_, using the `PyData Sphinx Theme `_ and the `numpydoc `_ extension - Documentation tests: `doctest `_ - Linter: `ruff `_ - Code format: `black `_ - Type checker: `mypy `_ Configuration metadata for each of these tools is stored in ``pyproject.toml``. Development Environment ----------------------- THzTools has been developed with the `Hatch `_ and `Conda `_. Brief instructions for their installation and use are below. Hatch ^^^^^ Follow the instructions at this `link `__ to install Hatch. Enter the environment by typing the following command from the top directory of the project (ie, ``~/thztools``):: hatch shell This will update any changes to the dependencies and enable several script shortcuts that can be used for testing, linting, and building documentation. To execute tests with ``pytest``:: hatch run test To lint the code base with ``ruff``:: hatch fmt To run type checking with ``mypy``:: hatch run lint:typing To build the documentation with ``sphinx`` and test examples with ``doctest``:: hatch run docs:build To exit the ``hatch`` environment:: exit Conda ^^^^^ Follow the instructions at this `link `__ to install Miniconda, a lightweight version of the Conda package and environment manager. Create the environment by typing the following command from the top directory of the project (ie, ``~/thztools``). The first line of the ``environment-dev.yml`` file sets the environment name to ``thztools``, and the last line uses ``pip`` to install the ``thztools`` package in `editable `_ mode for development. :: conda env create -f envs/environment-dev.yml To activate the ``thztools`` environment:: conda activate thztools To deactivate the environment when you are finished using ``thztools``:: conda deactivate More detailed instructions on using Conda to manage environments are available `here `_.