Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Developer Guide #123

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
We welcome contributions to scida in the form of bug reports, feature requests, design proposals and more.

For information on how to contribute, please see the https://cbyrohl.github.io/scida/develop.
77 changes: 76 additions & 1 deletion docs/developer.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,77 @@
# Developer Guide

TODO
We welcome contributions to scida, such as bug reports, feature requests, and design proposals.
This page contains information on how to contribute to scida.


## Development environment

### Clone the repository

Make a fork of the [repository](https://github.com/cbyrohl/scida), then clone the repository to your local machine:

``` bash
git clone https://github.com/YOURUSERNAME/scida
cd scida
```

### Install

We use [poetry](https://python-poetry.org/) to manage dependencies and the development environment.
After installing poetry, you can install scida and its dependencies with

``` bash
poetry install
```

This will create a virtual environment and install scida and its dependencies,
including development dependencies.
All commands, such as `python` and `pytest` will be run in this environment
by prepending `poetry run ...` to the command.

While using poetry is recommended, you can also install scida with pip
in a virtual environment of your choice:

``` bash
python -m venv scida_venv
source scida_venv/bin/activate
pip install -e .
```

Note that in latter case, you will have to manage the dependencies yourself, including development dependencies.
If choosing this path, remove any `poetry run` prefixes from the commands below accordingly.

### Run tests

To run the tests, use

``` bash
poetry run pytest
```

Many tests require test data sets. These might not be available to you and lead to many tests being skipped.


## Contributing code

### Code Formatting

We use the [black](https://github.com/psf/black) code formatter to ensure a consistent code style.
This style is ensured by the [pre-commit hook config](https://github.com/cbyrohl/scida/blob/main/.pre-commit-config.yaml).
Make sure to have [pre-commit](https://pre-commit.com/) installed and run

``` bash
pre-commit install
```

in the repository to install the hook.

### Docstring style

We use [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) to format docstrings.
Please annotate all functions and classes with docstrings accordingly.

### Testing

We use [pytest](https://docs.pytest.org/en/stable/) for testing. Add new tests for added functionality
in a test file in the `tests` directory. Make sure to run the tests before submitting a pull request.
15 changes: 15 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ Find some visual impressions [here](./impressions.md).
</div>
</div>
</div>
<div class="card" style="cursor: pointer;" style="cursor: pointer;" onclick="window.location='./developer';">
<div class="card__image-container">
<img
src="images/terminal-solid.svg"
/>
</div>
<div class="card__content">
<p class="card__title text--large">
Developer guide
</p>
<div class="card__info">
<p class="text--medium">How to modify and contribute to the package.</p>
</div>
</div>
</div>
</section>
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Installation

scida can be installed via [PyPI](https://pypi.org/). scida requires a Python version 3.9 or 3.10.
scida can be installed via [PyPI](https://pypi.org/). scida requires a Python version 3.9, 3.10 or 3.11.

??? tip "Encapsulating packages"
We recommend encapsulating your python environments. For example using [anaconda](https://www.anaconda.com/) or [virtualenv](https://virtualenv.pypa.io/en/latest/).
Expand Down
12 changes: 7 additions & 5 deletions docs/stylesheets/gridview.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
font-size: 16px;
line-height: 20px;
font-weight: 400;
margin-bottom: 10px;
margin-top: 15px;
}

.text--large {
font-size: 22px;
line-height: 20px;
font-weight: 500;
text-align: center;
margin-top: 0;
}

.cards {
Expand Down Expand Up @@ -40,6 +43,7 @@
padding-top: 45%;
overflow: hidden;
position: relative;
margin-bottom: 10px;
}

.card__image-container {
Expand All @@ -66,7 +70,8 @@
}

.card__content {
padding: 30px;
padding: 2px 10px;

}

.card__title {
Expand All @@ -75,10 +80,7 @@

.card__info {
display: flex;
padding-left: 10px;
padding-right: 10px;
padding-top: 0px;
padding-bottom: 0px;
padding: 0 10px;
align-self: end;
align-items: center;
}
Expand Down