Skip to content

Commit 46f650e

Browse files
committed
Merge branch 'main' into 27-orientational-entropy
Get CI updates
2 parents eedd9d1 + 8feeecc commit 46f650e

69 files changed

Lines changed: 727 additions & 295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/daily.yaml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeEntropy Daily Checks
1+
name: Daily Unit Tests
22

33
on:
44
schedule:
@@ -11,16 +11,16 @@ concurrency:
1111

1212
jobs:
1313
unit:
14-
name: Daily unit tests
14+
name: Unit (${{ matrix.os }}, ${{ matrix.python-version }})
1515
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 30
1617
strategy:
1718
fail-fast: false
1819
matrix:
19-
os: [ubuntu-24.04, windows-2025, macos-15]
20+
os: [ubuntu-24.04, macos-15, windows-2025]
2021
python-version: ["3.12", "3.13", "3.14"]
21-
timeout-minutes: 30
2222
steps:
23-
- name: Checkout repo
23+
- name: Checkout
2424
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2525

2626
- name: Set up Python ${{ matrix.python-version }}
@@ -29,38 +29,10 @@ jobs:
2929
python-version: ${{ matrix.python-version }}
3030
cache: pip
3131

32-
- name: Install CodeEntropy and its testing dependencies
32+
- name: Install (testing)
3333
run: |
34-
pip install --upgrade pip
35-
pip install -e .[testing]
36-
37-
- name: Run unit test suite
38-
run: pytest tests/unit -q
39-
40-
coverage:
41-
name: Coverage (ubuntu, latest python)
42-
runs-on: ubuntu-24.04
43-
timeout-minutes: 30
44-
steps:
45-
- name: Checkout repo
46-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
34+
python -m pip install --upgrade pip
35+
python -m pip install -e .[testing]
4736
48-
- name: Set up Python 3.14
49-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
50-
with:
51-
python-version: "3.14"
52-
cache: pip
53-
54-
- name: Install CodeEntropy and its testing dependencies
55-
run: |
56-
pip install --upgrade pip
57-
pip install -e .[testing]
58-
59-
- name: Run unit test suite with coverage
60-
run: pytest tests/unit --cov CodeEntropy --cov-report term-missing --cov-report xml -q
61-
62-
- name: Coveralls GitHub Action
63-
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
64-
with:
65-
github-token: ${{ secrets.GITHUB_TOKEN }}
66-
file: coverage.xml
37+
- name: Pytest (unit) • ${{ matrix.os }} • py${{ matrix.python-version }}
38+
run: python -m pytest tests/unit -q

.github/workflows/pr.yaml

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeEntropy CI
1+
name: Pull Request CI
22

33
on:
44
pull_request:
@@ -27,12 +27,12 @@ jobs:
2727
python-version: ${{ matrix.python-version }}
2828
cache: pip
2929

30-
- name: Install (testing)
30+
- name: Install testing dependencies
3131
run: |
3232
python -m pip install --upgrade pip
3333
python -m pip install -e .[testing]
3434
35-
- name: Pytest (unit) • ${{ matrix.os }} • py${{ matrix.python-version }}
35+
- name: Pytest (unit) • ${{ matrix.os }}, ${{ matrix.python-version }}
3636
run: python -m pytest tests/unit -q
3737

3838
regression-quick:
@@ -79,27 +79,36 @@ jobs:
7979
8080
docs:
8181
name: Docs
82+
needs: unit
8283
runs-on: ubuntu-24.04
8384
timeout-minutes: 25
85+
8486
steps:
8587
- name: Checkout
86-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
88+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
8789

8890
- name: Set up Python 3.14
89-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
91+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
9092
with:
9193
python-version: "3.14"
9294
cache: pip
9395

94-
- name: Install (docs)
96+
- name: Install
9597
run: |
9698
python -m pip install --upgrade pip
9799
python -m pip install -e .[docs]
98100
99101
- name: Build docs
100102
run: |
101-
cd docs
102-
make
103+
make -C docs clean
104+
make -C docs html SPHINXOPTS="-W --keep-going"
105+
106+
- name: Upload docs artifact
107+
if: always()
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: docs-html
111+
path: docs/_build/html
103112

104113
pre-commit:
105114
name: Pre-commit
@@ -129,3 +138,38 @@ jobs:
129138
git diff
130139
exit 1
131140
}
141+
142+
coverage:
143+
name: Coverage
144+
needs: unit
145+
runs-on: ubuntu-24.04
146+
timeout-minutes: 30
147+
steps:
148+
- name: Checkout repo
149+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
150+
151+
- name: Set up Python 3.14
152+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
153+
with:
154+
python-version: "3.14"
155+
cache: pip
156+
157+
- name: Install (testing)
158+
run: |
159+
python -m pip install --upgrade pip
160+
python -m pip install -e .[testing]
161+
162+
- name: Run unit test suite with coverage
163+
run: |
164+
pytest tests/unit \
165+
--cov CodeEntropy \
166+
--cov-report term-missing \
167+
--cov-report xml \
168+
-q
169+
170+
- name: Upload to Coveralls
171+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
172+
with:
173+
github-token: ${{ secrets.GITHUB_TOKEN }}
174+
file: coverage.xml
175+
fail-on-error: false

.github/workflows/release.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: Release CodeEntropy
22

33
on:
44
workflow_dispatch:
@@ -146,3 +146,47 @@ jobs:
146146
env:
147147
FLIT_USERNAME: __token__
148148
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
149+
150+
conda:
151+
name: publish conda to anaconda.org
152+
needs: [tag, release]
153+
runs-on: ubuntu-24.04
154+
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v4
158+
with:
159+
ref: main
160+
161+
- name: Set version in conda recipe
162+
run: |
163+
sed -i "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml
164+
grep '{% set version' conda-recipe/meta.yaml
165+
166+
- name: Setup Conda
167+
uses: conda-incubator/setup-miniconda@v3
168+
with:
169+
miniforge-variant: Miniforge3
170+
python-version: "3.12"
171+
auto-activate-base: false
172+
173+
- name: Install build tools
174+
shell: bash -l {0}
175+
run: |
176+
conda install -y conda-build anaconda-client
177+
conda config --add channels conda-forge
178+
conda config --set channel_priority strict
179+
conda config --set anaconda_upload no
180+
181+
- name: Build package
182+
shell: bash -l {0}
183+
run: |
184+
conda build conda-recipe
185+
186+
- name: Upload to Anaconda
187+
shell: bash -l {0}
188+
env:
189+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
190+
run: |
191+
PKG_PATH=$(conda build conda-recipe --output)
192+
anaconda -t "$ANACONDA_API_TOKEN" upload "$PKG_PATH" --user CCPBioSim --force

.github/workflows/weekly-docs.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeEntropy Weekly Docs
1+
name: Weekly Docs Build
22

33
on:
44
schedule:
@@ -19,6 +19,7 @@ jobs:
1919
os: [ubuntu-24.04, windows-2025, macos-15]
2020
python-version: ["3.12", "3.13", "3.14"]
2121
timeout-minutes: 30
22+
2223
steps:
2324
- name: Checkout repo
2425
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
@@ -31,11 +32,13 @@ jobs:
3132

3233
- name: Install python dependencies
3334
run: |
34-
pip install --upgrade pip
35-
pip install -e .[docs]
35+
python -m pip install --upgrade pip
36+
python -m pip install -e .[docs]
3637
37-
- name: Build docs
38-
run: cd docs && make
38+
- name: Build docs (warnings as errors)
39+
run: |
40+
make -C docs clean
41+
make -C docs html SPHINXOPTS="-W --keep-going"
3942
4043
- name: Upload docs artifacts on failure
4144
if: failure()

.github/workflows/weekly-regression.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeEntropy Weekly Regression
1+
name: Weekly Regression Tests
22

33
on:
44
schedule:

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,26 @@ repos:
1212
- id: check-added-large-files
1313
- id: check-merge-conflict
1414
- id: check-yaml
15+
exclude: ^conda-recipe/meta\.yaml$
1516
- id: check-toml
1617
- id: check-case-conflict
1718
- id: check-ast
1819
- id: end-of-file-fixer
1920
- id: trailing-whitespace
21+
22+
- repo: https://github.com/rstcheck/rstcheck
23+
rev: v6.2.0
24+
hooks:
25+
- id: rstcheck
26+
name: rstcheck (docstrings only)
27+
files: \.py$
28+
args: ["--report-level", "warning"]
29+
30+
- repo: local
31+
hooks:
32+
- id: sphinx-docs
33+
name: sphinx-build (pre-push, warnings as errors)
34+
entry: bash -lc 'make -C docs clean && make -C docs html SPHINXOPTS="-W --keep-going"'
35+
language: system
36+
pass_filenames: false
37+
stages: [pre-push]

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ keywords:
7676
- biomolecular simulations
7777
- protein flexibility
7878
license: MIT
79-
version: 1.0.7
80-
date-released: '2026-01-09'
79+
version: 2.0.0
80+
date-released: '2026-02-27'

CodeEntropy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
and statistical mechanics.
99
"""
1010

11-
__version__ = "1.0.7"
11+
__version__ = "2.0.0"

CodeEntropy/config/argparse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
55
1) A declarative argument specification (`ARG_SPECS`) used to build an
66
``argparse.ArgumentParser``.
7+
78
2) A `ConfigResolver` that:
9+
810
- loads YAML configuration (if present),
911
- merges YAML values with CLI values (CLI wins),
1012
- adjusts logging verbosity,
1113
- validates a subset of runtime inputs against the trajectory.
1214
1315
Notes:
16+
1417
- Boolean arguments are parsed via `str2bool` to support YAML/CLI interop and
1518
common string forms like "true"/"false".
1619
"""

CodeEntropy/entropy/configurational.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Conformational entropy utilities.
22
33
This module provides:
4-
* Assigning discrete conformational states for a single dihedral time series.
5-
* Computing conformational entropy from a sequence of state labels.
64
7-
The public surface area is intentionally small to keep responsibilities clear.
5+
- Assignment of discrete conformational states for a single dihedral time series.
6+
- Computation of conformational entropy from a sequence of state labels.
7+
88
"""
99

1010
from __future__ import annotations
@@ -127,15 +127,17 @@ def conformational_entropy_calculation(
127127
"""Compute conformational entropy for a sequence of state labels.
128128
129129
Entropy is computed as:
130+
130131
S = -R * sum_i p_i * ln(p_i)
131-
where p_i is the observed probability of state i in `states`.
132+
133+
where p_i is the observed probability of state i in ``states``.
132134
133135
Args:
134136
states: Sequence/array of discrete state labels. Empty/None yields 0.0.
135137
number_frames: Frame count metadata.
136138
137139
Returns:
138-
Conformational entropy in J/mol/K.
140+
float: Conformational entropy in J/mol/K.
139141
"""
140142
_ = number_frames
141143

0 commit comments

Comments
 (0)