Skip to content

Commit 2ffc4ca

Browse files
committed
formatting, and synchronizing some repo config settings with pyvcell
1 parent ad3d5af commit 2ffc4ca

File tree

19 files changed

+50
-50
lines changed

19 files changed

+50
-50
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ubuntu-latest
3030
strategy:
3131
matrix:
32-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
32+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3333
fail-fast: false
3434
defaults:
3535
run:

.github/workflows/on-release-main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ jobs:
3939

4040
- name: Deploy documentation
4141
run: poetry run mkdocs gh-deploy --force
42-

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ check: ## Run code quality tools.
1414
@echo "🚀 Static type checking: Running mypy"
1515
@poetry run mypy
1616
@echo "🚀 Checking for obsolete dependencies: Running deptry"
17-
@poetry run deptry .
17+
@poetry run deptry --exclude=.venv --exclude=tests .
1818

1919
.PHONY: test
2020
test: ## Test the code with pytest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Commit activity](https://img.shields.io/github/commit-activity/m/virtualcell/libvcell)](https://img.shields.io/github/commit-activity/m/virtualcell/libvcell)
77
[![License](https://img.shields.io/github/license/virtualcell/libvcell)](https://img.shields.io/github/license/virtualcell/libvcell)
88

9-
libvcell is a subset of VCell algorithms intended to support the [pyvcell](https://pypi.org/project/pyvcell/) python package. libvcell is available as a native executable and a python package.
9+
libvcell is a subset of VCell algorithms intended to support the [pyvcell](https://pypi.org/project/pyvcell/) python package. libvcell is available as a native executable and a python package.
1010

1111
- **Github repository**: <https://github.com/virtualcell/libvcell/>
1212
- **Documentation** <https://virtualcell.github.io/libvcell/>

libvcell/_internal/native_calls.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from pydantic import BaseModel
66

7-
from libvcell._internal.native_utils import VCellNativeLibraryLoader, IsolateManager
7+
from libvcell._internal.native_utils import IsolateManager, VCellNativeLibraryLoader
88

99

1010
class ReturnValue(BaseModel):
@@ -17,7 +17,9 @@ def __init__(self) -> None:
1717
self.loader = VCellNativeLibraryLoader()
1818
self.lib = self.loader.lib
1919

20-
def vcml_to_finite_volume_input(self, vcml_content: str, simulation_name: str, output_dir_path: Path) -> ReturnValue:
20+
def vcml_to_finite_volume_input(
21+
self, vcml_content: str, simulation_name: str, output_dir_path: Path
22+
) -> ReturnValue:
2123
try:
2224
with IsolateManager(self.lib) as isolate_thread:
2325
json_ptr: ctypes.c_char_p = self.lib.vcmlToFiniteVolumeInput(
@@ -32,7 +34,7 @@ def vcml_to_finite_volume_input(self, vcml_content: str, simulation_name: str, o
3234
# self.lib.freeString(json_ptr)
3335
return ReturnValue.model_validate_json(json_data=json_str)
3436
except Exception as e:
35-
logging.error(f"Error in vcml_to_finite_volume_input: {e}")
37+
logging.exception(f"Error in vcml_to_finite_volume_input: {e}")
3638
raise
3739

3840
def sbml_to_finite_volume_input(self, sbml_content: str, output_dir_path: Path) -> ReturnValue:
@@ -41,13 +43,13 @@ def sbml_to_finite_volume_input(self, sbml_content: str, output_dir_path: Path)
4143
json_ptr: bytes | None = self.lib.sbmlToFiniteVolumeInput(
4244
isolate_thread,
4345
ctypes.c_char_p(sbml_content.encode("utf-8")),
44-
ctypes.c_char_p(str(output_dir_path).encode("utf-8"))
46+
ctypes.c_char_p(str(output_dir_path).encode("utf-8")),
4547
)
4648
if json_ptr is None:
4749
raise ValueError("Native function returned null")
4850
json_str: str = ctypes.cast(json_ptr, ctypes.c_char_p).value.decode("utf-8")
4951
# self.lib.freeString(json_ptr)
5052
return ReturnValue.model_validate_json(json_data=json_str)
5153
except Exception as e:
52-
logging.error(f"Error in sbml_to_finite_volume_input: {e}")
53-
raise
54+
logging.exception(f"Error in sbml_to_finite_volume_input: {e}")
55+
raise

libvcell/_internal/native_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def _load_library(self) -> ctypes.CDLL:
3232
raise OSError("Could not find the shared library")
3333

3434
def _define_entry_points(self) -> None:
35-
3635
self.lib.vcmlToFiniteVolumeInput.restype = ctypes.c_char_p
3736
self.lib.vcmlToFiniteVolumeInput.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]
3837

@@ -59,4 +58,3 @@ def __enter__(self):
5958

6059
def __exit__(self, exc_type, exc_val, exc_tb):
6160
self.lib.graal_tear_down_isolate(self.isolate_thread)
62-

libvcell/libvcell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from pathlib import Path
22

3-
from libvcell._internal.native_calls import VCellNativeCalls, ReturnValue
3+
from libvcell._internal.native_calls import ReturnValue, VCellNativeCalls
44

55

66
class libvcell:
7-
87
@staticmethod
98
def vcml_to_finite_volume_input(vcml_content: str, simulation_name: str, output_dir_path: Path) -> None:
109
native = VCellNativeCalls()

pyproject.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,34 @@ readme = "README.md"
99
packages = [
1010
{include = "libvcell"}
1111
]
12+
include = [
13+
{path="libvcell/_internal/libs/*", format="wheel"}
14+
]
1215

1316
[tool.poetry.dependencies]
14-
python = ">=3.8,<4.0"
17+
python = ">=3.9,<4.0"
1518
pydantic = "^2.10.6"
1619

1720
[tool.poetry.group.dev.dependencies]
1821
pytest = "^7.2.0"
1922
pytest-cov = "^4.0.0"
2023
deptry = "^0.16.2"
2124
mypy = "^1.5.1"
22-
pre-commit = "^3.4.0"
25+
pre-commit = "^3.8.0"
2326
tox = "^4.11.1"
2427

2528
[tool.poetry.group.docs.dependencies]
26-
mkdocs = "^1.4.2"
27-
mkdocs-material = "^9.2.7"
28-
mkdocstrings = {extras = ["python"], version = "^0.26.1"}
29+
mkdocs = "^1.6.1"
30+
mkdocs-material = "^9.5.50"
31+
mkdocstrings = {extras = ["python"], version = "^0.27.0"}
2932

3033
[build-system]
3134
requires = ["poetry-core>=1.0.0"]
3235
build-backend = "poetry.core.masonry.api"
3336

3437
[tool.mypy]
35-
files = ["libvcell"]
36-
disallow_untyped_defs = "True"
37-
disallow_any_unimported = "True"
38-
no_implicit_optional = "True"
39-
check_untyped_defs = "True"
40-
warn_return_any = "True"
41-
warn_unused_ignores = "True"
42-
show_error_codes = "True"
38+
files = ["libvcell", "tests"]
39+
strict = true
4340

4441

4542

@@ -50,7 +47,7 @@ testpaths = ["tests"]
5047
target-version = "py39"
5148
line-length = 120
5249
fix = true
53-
select = [
50+
lint.select = [
5451
# flake8-2020
5552
"YTT",
5653
# flake8-bandit
@@ -82,11 +79,13 @@ select = [
8279
# tryceratops
8380
"TRY",
8481
]
85-
ignore = [
82+
lint.ignore = [
8683
# LineTooLong
8784
"E501",
8885
# DoNotAssignLambda
8986
"E731",
87+
# avoid specifiying long messages outside the exception class
88+
"TRY003",
9089
]
9190

9291
[tool.ruff.format]

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from tests.fixtures.data_fixtures import vcml_file_path, vcml_sim_name, sbml_file_path, temp_output_dir # noqa: F401
1+
from tests.fixtures.data_fixtures import sbml_file_path, temp_output_dir, vcml_file_path, vcml_sim_name # noqa: F401

0 commit comments

Comments
 (0)