Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/test-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
for w in ./dist/*.whl; do python -m pip install $w; done
- name: Lint with flake8
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
.vscode
.tox
dist
!.github
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ keywords:
- chunking
- chunks
license: Apache-2.0
version: v1.0.3
version: 1.0.4
date-released: '2025-04-01'
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# [thread-chunks](README.md) Change Log

## Release 1.0.4

- Added the license to the documentation
- Added link to the GitHub repository to the navigation pane in the documentation
- Added a version consistency test
- Added [tox](https://tox.wiki/) support for user testing.

## Release 1.0.3

- Hid superfluous table of contents in the index page of the User Guide in the documentation;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ Source code can be found at: [https://github.com/Christopher-K-Long/thread-chunk

## Version and Changes

The current version is [`1.0.3`](ChangeLog.md#release-103). Please see the [Change Log](ChangeLog.md) for more
The current version is [`1.0.4`](ChangeLog.md#release-104). Please see the [Change Log](ChangeLog.md) for more
details.
4 changes: 4 additions & 0 deletions docs/License.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
License
=======
.. include:: ../LICENSE
:parser: myst_parser.sphinx_
8 changes: 5 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ thread-chunks
=============

.. include:: ../README.md
:parser: myst_parser.sphinx_
:start-after: # thread-chunks
:parser: myst_parser.sphinx_
:start-after: # thread-chunks


.. toctree::
Expand All @@ -18,4 +18,6 @@ thread-chunks
user_guide/index
reference/index
ChangeLog.md.rst

License
GitHub <https://github.com/Christopher-K-Long/thread-chunks>
PyPI <https://pypi.org/project/thread-chunks/>
2 changes: 1 addition & 1 deletion docs/user_guide/actors.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ output = chunk(g, parameters, actors, chunk_size=chunk_size)
Now you know everything you need to go and use ``thread-chunks``!

---
[Previous](checkpointing.md)
[Previous](checkpointing.md) | [Next](running_tests.md)
1 change: 1 addition & 0 deletions docs/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ User Guide
chunking
checkpointing
actors
running_tests

.. include:: overview.md
:parser: myst_parser.sphinx_
Expand Down
4 changes: 4 additions & 0 deletions docs/user_guide/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
- [Checkpointing](checkpointing.md)
- [Actors](actors.md)

## Running Tests

- [Running Tests](running_tests.md)

---
[Next](getting_started.md)
32 changes: 32 additions & 0 deletions docs/user_guide/running_tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Running Tests

Current status of units tests:

[![Unit Tests](https://github.com/Christopher-K-Long/thread-chunks/actions/workflows/test-python-package.yml/badge.svg)](https://github.com/Christopher-K-Long/thread-chunks/actions/workflows/test-python-package.yml)

You can run the unit tests yourself using [pytest](https://docs.pytest.org) or [tox](https://tox.wiki/).

## Using [tox](https://tox.wiki/)

Once [tox](https://tox.wiki/) is installed you can execute the command
```bash
tox
```
in from a terminal in the root directory of thread-chunks to execute the tests for your installed python interpreter.

## Using [pytest](https://docs.pytest.org)

To execute the tests with [pytest](https://docs.pytest.org) you will need to set up a python environment with thread-chunks and the packages in `texts/requirements.txt`. For example, you can run
```bash
pip install ./
pip install tests/requirements.txt
```
from the root directory of thread-chunks to install all the requirements. Next the tests can be executed with the command
```bash
pytest
```
from the root directory of thread-chunks.

---

[Previous](actors.md)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "thread-chunks"
version = "1.0.3"
version = "1.0.4"
authors = [
{ name="Christopher_K._Long", email="ckl45@cam.ac.uk" },
]
Expand Down
8 changes: 8 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ray
toml
tqdm
numpy
pyyaml
pytest
cloudpickle
saveable-objects
26 changes: 26 additions & 0 deletions tests/test_version_consistency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import toml
import yaml

PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
README_FILE = os.path.join(PROJECT_DIR, "README.md")
TOML_FILE = os.path.join(PROJECT_DIR, "pyproject.toml")
CITATION_FILE = os.path.join(PROJECT_DIR, "CITATION.cff")
CHANGELOG_FILE = os.path.join(PROJECT_DIR, "ChangeLog.md")

def test_version_consistency():
toml_version = toml.load(TOML_FILE)["project"]["version"]
with open(CITATION_FILE, "r") as f:
citation_content = yaml.safe_load(f)
citation_version = citation_content["version"]
assert citation_version == toml_version
with open(README_FILE, "r") as f:
for line in f.readline():
if "`](ChangeLog.md#release-" in line:
assert f"[`{toml_version}`](ChangeLog.md#release-{toml_version.replace('.', '')})" in line
with open(CHANGELOG_FILE, "r") as f:
for line in f.readlines():
if line.startswith("## "):
assert toml_version in line
break
else: assert False, "Version not found in CHANGELOG.md"
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tox]
requires =
tox>=4
envlist = 3X

[testenv]
description = run unit tests
deps = -rtests/requirements.txt
commands = pytest tests