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

First update to many of the base configuration files to better match … #8

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ docs/_build
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.eclipse
.vscode
.spyderproject
.spyproject

Expand All @@ -67,3 +69,6 @@ venv.bak/
*.swp
*.swo
*.orig

# testing
test_models/
13 changes: 8 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
cff-version: "1.2.0"
title: "dgl_abm"
authors:
- family-names: Grootes
given-names: Meiert
- family-names: Atlas
given-names: Team
orcid: "https://orcid.org/0000-0000-0000-0000"
date-released: 2024-10-25
date-released: 20??-MM-DD
doi: <insert DOI here>
version: "0.1.0"
repository-code: "https://github.com/SDCCA/dgl_abm"
keywords:
- "ABM"
- " Tensor"
- " PyTorch"
- "Graph"
- "PyTorch"
- "Tensor"
message: "If you use this software, please cite it using these metadata."
license: Apache-2.0
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This product includes dgl_abm, software developed by
Meiert W. Grootes.
Netherlands eScience Center.
20 changes: 18 additions & 2 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ To see the results on the command line, run
coverage report
```

`coverage` can also generate output in HTML and other formats; see `coverage help` for more information.## Running linters locally
`coverage` can also generate output in HTML and other formats; see `coverage help` for more information.

## Running linters locally

For linting and sorting imports we will use [ruff](https://beta.ruff.rs/docs/). Running the linters requires an
activated virtual environment with the development tools installed.
Expand All @@ -71,9 +73,14 @@ ruff check .

# linter with automatic fixing
ruff check . --fix

# linter with reformatting enabled
ruff format .
```

To fix readability of your code style you can use [yapf](https://github.com/google/yapf).## Generating the API docs
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).

## Generating the API docs

```shell
cd docs
Expand Down Expand Up @@ -113,6 +120,15 @@ bump-my-version bump minor # bumps from e.g. 0.3.2 to 0.4.0
bump-my-version bump patch # bumps from e.g. 0.3.2 to 0.3.3
```

The code also compares stored model versions to the current code version when loading existing models.

Updating the current code version, stored in `src/version.md` is done with a script:

```shell
cd src
regen_version.sh
```

## Making a release

This section describes how to make a release in 3 parts:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ The project setup is documented in [project_setup.md](project_setup.md). Feel fr

## Installation

To install dgl_abm from GitHub repository, do:
To install dgl_abm from GitHub repository*, do:

```console
git clone [email protected]:SDCCA/dgl_abm.git
cd dgl_abm
python -m pip install .
```
\* - the project is currently under development and is not release-ready yet.

## Documentation

Expand Down
11 changes: 11 additions & 0 deletions environment_cuda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To run dgl_ptm on an infra with NVIDIA GPUs, you need to install cuda version
# of dgl. This environment file specifies the dgl conda channel and cuda version
# of dgl.
name: dgl_abm_cuda
channels:
- defaults
dependencies:
- python>=3.11,<3.12
- dglteam/label/cu121::dgl
- pip:
- -e ./dgl_abm # install dgl_abm in the editable mode, # TODO change to the actual pypi packages
4 changes: 2 additions & 2 deletions project_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ checklist](https://guide.esciencecenter.nl/#/best_practices/checklist).

This repository is set up with Python versions:

- 3.10
- 3.11
- 3.12

Expand Down Expand Up @@ -57,7 +56,8 @@ help you decide which tool to use for packaging.
- The documentation is set up with the ReadTheDocs Sphinx theme.
- Check out its [configuration options](https://sphinx-rtd-theme.readthedocs.io/en/latest/).
- [AutoAPI](https://sphinx-autoapi.readthedocs.io/) is used to generate documentation for the package Python objects.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to use sphinx or mkdocs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx is used by the template. I don't really know the differences, so I don't have a preference here...

- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=writingdocumentation)
- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=writingdocumentation)

## Coding style conventions and code quality

Expand Down
27 changes: 21 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ build-backend = "setuptools.build_meta"

[project]
authors = [
{ name = "Meiert W. Grootes", email = "[email protected]" }
{name = "Meiert W. Grootes", email = "[email protected]"},
{name = "Debraj Roy"},
{name = "Fakhereh Sarah Alidoost"},
{name = "Pranav Chandramouli"},
{name = "Thijs van Lankveld"},
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
Expand All @@ -18,17 +22,28 @@ classifiers = [
"",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = []
dependencies = [
"dask",
"dgl",
"numpy",
"pydantic>=2",
"scipy==1.10.1",
"torch==2.1.1",
"torchdata==0.7.1",
"torchvision",
"torchaudio",
"xarray",
"zarr",
]
description = "ABM modelling framework using networks and tensor algebra supported by the DGL library"
keywords = ["ABM"," Tensor"," PyTorch"]
keywords = ["ABM", "Graph", "PyTorch", "Tensor"]
license = {file = "LICENSE"}
name = "dgl_abm"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.8"
requires-python = ">=3.11, <3.12"
version = "0.1.0"

[project.optional-dependencies]
Expand Down Expand Up @@ -85,7 +100,7 @@ extras = dev
[tool.ruff]
line-length = 120
output-format = "concise"
extend-exclude = ["docs"]
extend-exclude = ["docs", "build"]

[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
Expand Down
3 changes: 3 additions & 0 deletions src/regen_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
git rev-parse HEAD > version.md

1 change: 1 addition & 0 deletions src/version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9b09149e38a6ae5c9889e0418d4520fa74b5c551
Loading