Compare commits

..

No commits in common. "66faf9cf33b0fdebe1f4c6a73c786432deed24d2" and "acab85df820280581b2254deab773971bf290728" have entirely different histories.

7 changed files with 11 additions and 89 deletions

View file

@ -1,24 +0,0 @@
name: Pytest
jobs:
test:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
show-progress: true
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install corrlib
run: uv sync --locked --all-extras --dev
- name: Run tests
# For example, using `pytest`
run: uv run pytest tests

View file

@ -20,3 +20,4 @@ from .import input as input
from .initialization import *
from .meas_io import *
from .find import *
from .version import __version__

View file

@ -1,6 +1,6 @@
from typing import Optional
import typer
from corrlib import __app_name__
from corrlib import __app_name__, __version__
from .initialization import create
from .toml import import_tomls, update_project, reimport_project
from .find import find_record, list_projects
@ -8,7 +8,6 @@ from .tools import str2list
from .main import update_aliases
from .meas_io import drop_cache as mio_drop_cache
import os
from importlib.metadata import version, PackageNotFoundError
app = typer.Typer()
@ -16,7 +15,7 @@ app = typer.Typer()
def _version_callback(value: bool) -> None:
if value:
print(__app_name__, version(__app_name__))
typer.echo(f"{__app_name__} v{__version__}")
raise typer.Exit()

View file

@ -2,24 +2,24 @@ import os
import datalad.api as dl
def str2list(string: str):
def str2list(string):
return string.split(",")
def list2str(mylist):
s = ",".join(mylist)
return s
cached: bool = True
cached = True
def m2k(m: float) -> float:
def m2k(m):
return 1/(2*m+8)
def k2m(k: float) -> float:
def k2m(k):
return (1/(2*k))-4
def get_file(path: str, file: str):
def get_file(path, file):
if file == "backlogger.db":
print("Downloading database...")
else:

View file

@ -1,35 +1,6 @@
[build-system]
requires = ["setuptools >= 63.0.0", "wheel", "setuptools-scm"]
requires = ["setuptools >= 63.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "corrlib"
dynamic = ["version"]
dependencies = [
"gitpython>=3.1.45",
'pyerrors>=2.11.1',
'datalad>=1.1.0',
'typer>=0.12.5'
]
description = "Python correlation library"
authors = [
{ name = 'Justus Kuhlmann', email = 'j_kuhl19@uni-muenster.de'}
]
[project.scripts]
pcl = "corrlib.cli:app"
[tool.setuptools.packages.find]
include = ["corrlib", "corrlib.*"]
[tool.setuptools.dynamic]
version = { file = "corrlib/version.py" }
[tool.ruff.lint]
ignore = ["F403"]
[dependency-groups]
dev = [
"pytest>=9.0.1",
"pytest-pretty>=1.3.0",
]

View file

@ -14,4 +14,4 @@ def test_toml_check_measurement_data():
"names": ['list', 'of', 'names']
}
}
t.check_measurement_data(measurements, "sfcf")
t.check_measurement_data(measurements)

View file

@ -1,25 +0,0 @@
from corrlib import tools as tl
def test_m2k():
assert tl.m2k(0.1) == 1/(2*0.1+8)
assert tl.m2k(0.5) == 1/(2*0.5+8)
assert tl.m2k(1.0) == 1/(2*1.0+8)
def test_k2m():
assert tl.k2m(0.1) == (1/(2*0.1))-4
assert tl.k2m(0.5) == (1/(2*0.5))-4
assert tl.k2m(1.0) == (1/(2*1.0))-4
def test_str2list():
assert tl.str2list("a,b,c") == ["a", "b", "c"]
assert tl.str2list("1,2,3") == ["1", "2", "3"]
def test_list2str():
assert tl.list2str(["a", "b", "c"]) == "a,b,c"
assert tl.list2str(["1", "2", "3"]) == "1,2,3"