-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the way analysis settings are set (#110)
* Update settings specification for analysis wrappers - Only allow specification through keyword arguments, use `with_settings` classmethod to use a settings object - Use __init_subclass__ to automatically determine the settings object type from the class signature - Use __init_subclass__ to specify class-level settings as arguments instead of attributes * Add test to check if analysis wrapper's __init__ only accepts keyword-only parameters * Allow batch updating settings with update_settings --------- Co-authored-by: lvanvught <[email protected]>
- Loading branch information
Showing
27 changed files
with
345 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,17 @@ build-backend = "hatchling.build" | |
[project] | ||
name = "zospy" | ||
authors = [ | ||
{name = "Luc van Vught"}, | ||
{name = "Jan-Willem Beenakker"}, | ||
{name = "Corné Haasjes"} | ||
{ name = "Luc van Vught" }, | ||
{ name = "Jan-Willem Beenakker" }, | ||
{ name = "Corné Haasjes" } | ||
] | ||
maintainers = [ | ||
{name = "MReye research group", email = "[email protected]"} | ||
{ name = "MReye research group", email = "[email protected]" } | ||
] | ||
|
||
description = "A Python package used to communicate with Zemax OpticStudio through the API" | ||
readme = "README.md" | ||
license = {file = "LICENSE.txt"} | ||
license = { file = "LICENSE.txt" } | ||
keywords = ["Zemax", "OpticStudio", "API", "ZOSAPI"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
|
@@ -30,7 +30,8 @@ dependencies = [ | |
"pydantic >= 2.4.0", | ||
"numpy", | ||
"semver >= 3.0.0,<4", | ||
"eval_type_backport", # TODO: Remove when dropping support for Python 3.9 | ||
"eval_type_backport; python_version <= '3.9'", # TODO: Remove when dropping support for Python 3.9 | ||
"typing_extensions; python_version <= '3.10'" | ||
] | ||
dynamic = ["version"] | ||
|
||
|
@@ -57,6 +58,9 @@ path = "zospy/__init__.py" | |
[tool.hatch.envs.default] | ||
python = "3.12" | ||
installer = "uv" | ||
path = ".venv" | ||
dependencies = ["pytest"] | ||
|
||
|
||
[tool.hatch.envs.default.scripts] | ||
test-extension = "hatch test --extension {args}" | ||
|
@@ -118,7 +122,6 @@ extend-include = [ | |
exclude = [ | ||
"zospy/api/_ZOSAPI", | ||
"zospy/api/_ZOSAPI_constants", | ||
|
||
# TODO: Change this when movind the old analyses to zospy.analyses.old | ||
"zospy/analyses/base.py", | ||
"zospy/analyses/extendedscene.py", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.