Skip to content
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
11 changes: 4 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
Expand All @@ -11,16 +8,16 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and the package
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 21.5b0
rev: 25.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/myint/autoflake
rev: v1.4
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

51 changes: 47 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
"wheel"
]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "sciunit"
version = "0.3.0.dev.0"
description = "A test-driven framework for formally validating scientific models against data."
readme = { file = "README.md", content-type = "text/markdown" }
license = "MIT"
authors = [
{ name = "Rick Gerkin", email = "rgerkin@asu.edu" }
]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"bs4",
"cerberus>=1.2",
"deepdiff",
"gitpython",
"importlib-metadata",
"ipykernel",
"ipython",
"jsonpickle",
"lxml",
"matplotlib",
"nbconvert",
"nbformat",
"pandas>=0.18",
"quantities>=0.13.0",
]

[project.urls]
Homepage = "http://sciunit.scidash.org"

[project.scripts]
sciunit = "sciunit.__main__:main"

[tool.setuptools.packages.find]
where = ["."]
include = ["sciunit*"]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

8 changes: 4 additions & 4 deletions sciunit/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def source_check(cls, model: "sciunit.Model") -> bool:
dis_output = [word for word in dis_output if word]

if (
"(NotImplementedError)" in dis_output
or "(unimplemented)" in dis_output
or "(CapabilityNotImplementedError)" in dis_output
or "(NotImplemented)" in dis_output
any("NotImplementedError" in t for t in dis_output)
or any("unimplemented" in t for t in dis_output)
or any("CapabilityNotImplementedError" in t for t in dis_output)
or any("NotImplemented" in t for t in dis_output)
):
cap_source = inspect.getsource(getattr(cls, method))
model_source = inspect.getsource(getattr(model, method))
Expand Down
8 changes: 4 additions & 4 deletions sciunit/scores/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,15 @@ def __setattr__(self, attr, value):

@property
def related_data(self) -> pd.DataFrame:
return self.applymap(lambda x: x.related_data)
return self.map(lambda x: x.related_data)

@property
def scores_flat(self) -> list:
return self.values.tolist()

@property
def scores(self) -> pd.DataFrame:
return self.applymap(lambda x: x.score)
return self.map(lambda x: x.score)

score = scores # Backwards compatibility

Expand All @@ -334,7 +334,7 @@ def norm_scores(self) -> pd.DataFrame:
Returns:
DataFrame: The DataFrame instance that contains norm scores as a matrix.
"""
return self.applymap(lambda x: x.norm_score)
return self.map(lambda x: x.norm_score)

def stature(self, test: Test, model: Model) -> int:
"""Computes the relative rank of a model on a test compared to other models that were asked to take the test.
Expand Down Expand Up @@ -392,7 +392,7 @@ def _repr_html_(self):
if self.show_mean:
sm = sm.add_mean()
if self.colorize:
obj = sm.style.applymap(sm.apply_score_color)
obj = sm.style.map(sm.apply_score_color)
else:
obj = super(ScoreMatrix, sm)
return obj._repr_html_()
Expand Down
4 changes: 2 additions & 2 deletions sciunit/scores/collections_m2m.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_group(self, x: list) -> Any:

def __getattr__(self, name: str) -> Any:
if name in ["score", "norm_score", "related_data"]:
attr = self.applymap(lambda x: getattr(x, name))
attr = self.map(lambda x: getattr(x, name))
else:
attr = super(ScoreMatrixM2M, self).__getattribute__(name)
return attr
Expand All @@ -171,4 +171,4 @@ def norm_scores(self) -> pd.DataFrame:
Returns:
DataFrame: A pandas DataFrame instance that contains norm scores.
"""
return self.applymap(lambda x: x.norm_score)
return self.map(lambda x: x.norm_score)
2 changes: 1 addition & 1 deletion sciunit/suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(
optimizer (optional): A function to bind to self.optimize (first argument must be a TestSuite). Defaults to None.
"""

self.name = name if name else "Suite_%d" % random.randint(0, 1e12)
self.name = name if name else "Suite_%d" % random.randint(0, 10**12)
if isinstance(tests, dict):
for key, value in tests.items():
if not isinstance(value, Test):
Expand Down
41 changes: 0 additions & 41 deletions setup.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

Loading