Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eedd9d1
adding basic orientational entropy
skfegan Feb 27, 2026
46f650e
Merge branch 'main' into 27-orientational-entropy
skfegan Feb 27, 2026
ab8ff89
fixing output formating for orientational entropy
skfegan Mar 1, 2026
85d126a
adding documentation about orientational entropy
skfegan Mar 2, 2026
a694bd0
adding rdkit to pyproject.toml
skfegan Mar 2, 2026
44bd758
tidy up code
skfegan Mar 4, 2026
6c984e6
update regression test baselines
skfegan Mar 4, 2026
a06e379
removing redundant tests
skfegan Mar 4, 2026
c18e010
tests
skfegan Mar 6, 2026
b146c1b
more testing
skfegan Mar 11, 2026
99aead1
tests: fix RDKit mocking in `_get_linear` tests
harryswift01 Mar 11, 2026
8f92ef7
include `rdkit` within `autodoc_mock_imports`
harryswift01 Mar 11, 2026
4b5d7f3
remove `search_object` argument from `get_grid_neighbors`
harryswift01 Mar 11, 2026
a3f0229
test for grid search
skfegan Mar 11, 2026
da86beb
Merge branch '27-orientational-entropy' of https://github.com/CCPBioS…
skfegan Mar 11, 2026
260df88
fix type checking within `reporter.py` and `dihedrals`
harryswift01 Mar 11, 2026
851f6d5
fix(types): resolve Pylance optional access errors and tighten typing…
harryswift01 Mar 11, 2026
284ddc9
fix(types): allow optional dict by changing data to dict[str, Any] | …
harryswift01 Mar 11, 2026
734001d
fix(types): update `level_dag.py` to correct pylance typings
harryswift01 Mar 11, 2026
98b65e7
marking regression tests as slow except for dna which is quick
skfegan Mar 13, 2026
b98888b
ci(tests): remove pytest -q to show real-time test progress
harryswift01 Mar 13, 2026
72e3964
test(unit): add tests for `Neighbors.get_symmetry`
harryswift01 Mar 13, 2026
281fa2d
test(unit): add unit tests for `Neighbors._get_rdkit_mol`
harryswift01 Mar 13, 2026
da89675
test(unit): add branch coverage tests for Search neighbor methods
harryswift01 Mar 13, 2026
69dc68c
test(unit): add tests for `ForceTorqueCalculator._displacements_relat…
harryswift01 Mar 13, 2026
9b462c5
ci(tests): remove `timeout-minutes` from `weekly-regression.yaml`
harryswift01 Mar 13, 2026
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/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
python -m pip install -e .[testing]

- name: Pytest (unit) • ${{ matrix.os }} • py${{ matrix.python-version }}
run: python -m pytest tests/unit -q
run: python -m pytest tests/unit
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python -m pip install -e .[testing]

- name: Pytest (unit) • ${{ matrix.os }}, ${{ matrix.python-version }}
run: python -m pytest tests/unit -q
run: python -m pytest tests/unit

regression-quick:
name: Regression (quick)
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
python -m pip install -e .[testing]

- name: Pytest (regression quick)
run: python -m pytest tests/regression -q
run: python -m pytest tests/regression

- name: Upload artifacts (failure)
if: failure()
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/weekly-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
regression:
name: Regression tests (including slow)
runs-on: ubuntu-24.04
timeout-minutes: 180
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
Expand All @@ -36,7 +35,7 @@ jobs:
pip install -e .[testing]

- name: Run regression test suite
run: pytest tests/regression -q --run-slow
run: pytest tests/regression --run-slow

- name: Upload regression artifacts on failure
if: failure()
Expand Down
34 changes: 20 additions & 14 deletions CodeEntropy/config/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import logging
import os
from dataclasses import dataclass
from typing import Any, Dict, Optional, Set
from typing import Any

import yaml

Expand All @@ -48,11 +48,11 @@ class ArgSpec:
help: str
default: Any = None
type: Any = None
action: Optional[str] = None
nargs: Optional[str] = None
action: str | None = None
nargs: str | None = None


ARG_SPECS: Dict[str, ArgSpec] = {
ARG_SPECS: dict[str, ArgSpec] = {
"top_traj_file": ArgSpec(
type=str,
nargs="+",
Expand Down Expand Up @@ -145,6 +145,12 @@ class ArgSpec:
default=True,
help="Use bonded axes to rotate forces for UA level vibrational entropies",
),
"search_type": ArgSpec(
type=str,
default="RAD",
help="Type of neighbor search to use."
"Default RAD; grid search is also available",
),
}


Expand All @@ -159,7 +165,7 @@ class ConfigResolver:
- validating trajectory-related numeric parameters
"""

def __init__(self, arg_specs: Optional[Dict[str, ArgSpec]] = None) -> None:
def __init__(self, arg_specs: dict[str, ArgSpec] | None = None) -> None:
"""Initialize the manager.

Args:
Expand All @@ -168,7 +174,7 @@ def __init__(self, arg_specs: Optional[Dict[str, ArgSpec]] = None) -> None:
"""
self._arg_specs = dict(arg_specs or ARG_SPECS)

def load_config(self, directory_path: str) -> Dict[str, Any]:
def load_config(self, directory_path: str) -> dict[str, Any]:
"""Load the first YAML config file found in a directory.

The current behavior matches your existing workflow:
Expand All @@ -188,7 +194,7 @@ def load_config(self, directory_path: str) -> Dict[str, Any]:

config_path = yaml_files[0]
try:
with open(config_path, "r", encoding="utf-8") as file:
with open(config_path, encoding="utf-8") as file:
config = yaml.safe_load(file) or {"run1": {}}
logger.info("Loaded configuration from: %s", config_path)
return config
Expand Down Expand Up @@ -253,7 +259,7 @@ def build_parser(self) -> argparse.ArgumentParser:
)
continue

kwargs: Dict[str, Any] = {}
kwargs: dict[str, Any] = {}
if spec.type is not None:
kwargs["type"] = spec.type
if spec.default is not None:
Expand All @@ -266,7 +272,7 @@ def build_parser(self) -> argparse.ArgumentParser:
return parser

def resolve(
self, args: argparse.Namespace, run_config: Optional[Dict[str, Any]]
self, args: argparse.Namespace, run_config: dict[str, Any] | None
) -> argparse.Namespace:
"""Merge CLI arguments with YAML configuration and adjust logging level.

Expand Down Expand Up @@ -306,8 +312,8 @@ def resolve(

@staticmethod
def _detect_cli_overrides(
args_dict: Dict[str, Any], default_dict: Dict[str, Any]
) -> Set[str]:
args_dict: dict[str, Any], default_dict: dict[str, Any]
) -> set[str]:
"""Detect which args were explicitly overridden in the CLI.

Args:
Expand All @@ -322,8 +328,8 @@ def _detect_cli_overrides(
def _apply_yaml_defaults(
self,
args: argparse.Namespace,
run_config: Dict[str, Any],
cli_provided: Set[str],
run_config: dict[str, Any],
cli_provided: set[str],
) -> None:
"""Apply YAML values onto args for keys not provided by CLI.

Expand All @@ -336,7 +342,7 @@ def _apply_yaml_defaults(
if yaml_value is None or key in cli_provided:
continue
if key in self._arg_specs:
logger.debug("Using YAML value for %s: %s", key, yaml_value)
logger.debug(f"Using YAML value for {key}: {yaml_value}")
setattr(args, key, yaml_value)

def _ensure_defaults(self, args: argparse.Namespace) -> None:
Expand Down
6 changes: 3 additions & 3 deletions CodeEntropy/config/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import logging
import os
import pickle
from typing import Any, Dict, Optional
from typing import Any

import MDAnalysis as mda
import requests
Expand Down Expand Up @@ -112,7 +112,7 @@ def create_job_folder() -> str:

return new_folder_path

def load_citation_data(self) -> Optional[Dict[str, Any]]:
def load_citation_data(self) -> dict[str, Any] | None:
"""Load CITATION.cff from GitHub.

If the request fails (offline, blocked, etc.), returns None.
Expand Down Expand Up @@ -335,7 +335,7 @@ def _build_universe(
kcal_units = args.kcal_force_units

if forcefile is None:
logger.debug("Loading Universe with %s and %s", tprfile, trrfile)
logger.debug(f"Loading Universe with {tprfile} and {trrfile}")
return mda.Universe(tprfile, trrfile, format=fileformat)

return universe_operations.merge_forces(
Expand Down
5 changes: 2 additions & 3 deletions CodeEntropy/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import logging
import os
from typing import Dict, Optional

from rich.console import Console
from rich.logging import RichHandler
Expand Down Expand Up @@ -55,7 +54,7 @@ class LoggingConfig:
handlers: Mapping of handler name to handler instance.
"""

_console: Optional[Console] = None
_console: Console | None = None

@classmethod
def get_console(cls) -> Console:
Expand All @@ -80,7 +79,7 @@ def __init__(self, folder: str, level: int = logging.INFO) -> None:

self.level = level
self.console = self.get_console()
self.handlers: Dict[str, logging.Handler] = {}
self.handlers: dict[str, logging.Handler] = {}

self._setup_handlers()

Expand Down
Loading
Loading