From ac952220e5d685306edd9756c4fec8e51aa93926 Mon Sep 17 00:00:00 2001 From: Kristoffer Skare Date: Mon, 16 Jun 2025 11:07:59 +0200 Subject: [PATCH 1/3] Update changelog and version numbers --- CHANGELOG.md | 2 + docs/source/conf.py | 2 +- pyproject.toml | 220 +++++++++++++++++++++----------------------- 3 files changed, 110 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b77136c..f62a520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e ## Unreleased +## [1.0.3] + ### Changed * Add README page for Examples dir, add generated FMUs for each example (given FMI tools page requirements for Examples), and update the files generated by mlfmu codegen (add for pyspark example) diff --git a/docs/source/conf.py b/docs/source/conf.py index a326fd9..7c52bf8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ author = "Kristoffer Skare, Jorge Luis Mendez, Stephanie Kemna, Melih Akdag" # The full version, including alpha/beta/rc tags -release = "1.0.2" +release = "1.0.3" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 104f3f0..61f3145 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,158 +1,152 @@ [build-system] +build-backend = "hatchling.build" requires = [ - "hatchling", + "hatchling", ] -build-backend = "hatchling.build" [tool.hatch.build.targets.sdist] only-include = [ - "src/mlfmu", - "tests", - ".coveragerc", - ".editorconfig", - "pytest.ini", - "ruff.toml", - "uv.lock", + "src/mlfmu", + "tests", + ".coveragerc", + ".editorconfig", + "pytest.ini", + "ruff.toml", + "uv.lock", ] [tool.hatch.build.targets.wheel] packages = [ - "src/mlfmu", + "src/mlfmu", ] [project] -name = "mlfmu" -version = "1.0.2" -description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)" -readme = "README.md" -requires-python = ">= 3.10" -license = { file = "LICENSE" } authors = [ - { name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com" }, - { name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com" }, -] -maintainers = [ - { name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com" }, - { name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com" }, - { name = "Hee Jong Park", email = "hee.jong.park@dnv.com" }, - { name = "Claas Rostock", email = "claas.rostock@dnv.com" }, -] -keywords = [ + {name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com"}, + {name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com"}, ] classifiers = [ - "Development Status :: 3 - Alpha", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - # "Operating System :: MacOS", - "Environment :: Console", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering", - "Topic :: Software Development :: Libraries :: Python Modules", + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", # "Operating System :: MacOS", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ - "dictIO>=0.3.4", - "pydantic>=2.6", - "json-schema-for-humans>=0.4.7", - "onnxruntime==1.18.1", - "conan>=2.1", + "dictIO>=0.3.4", + "pydantic>=2.6", + "json-schema-for-humans>=0.4.7", + "onnxruntime==1.18.1", + "conan>=2.1", +] +description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)" +keywords = [] +license = {file = "LICENSE"} +maintainers = [ + {name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com"}, + {name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com"}, + {name = "Hee Jong Park", email = "hee.jong.park@dnv.com"}, + {name = "Claas Rostock", email = "claas.rostock@dnv.com"}, ] +name = "mlfmu" +readme = "README.md" +requires-python = ">= 3.10" +version = "1.0.3" [project.urls] -Homepage = "https://github.com/dnv-opensource/mlfmu" +Changelog = "https://github.com/dnv-opensource/mlfmu/blob/main/CHANGELOG.md" Documentation = "https://dnv-opensource.github.io/mlfmu/README.html" -Repository = "https://github.com/dnv-opensource/mlfmu.git" +Homepage = "https://github.com/dnv-opensource/mlfmu" Issues = "https://github.com/dnv-opensource/mlfmu/issues" -Changelog = "https://github.com/dnv-opensource/mlfmu/blob/main/CHANGELOG.md" - +Repository = "https://github.com/dnv-opensource/mlfmu.git" [tool.uv] dev-dependencies = [ - "pytest>=8.3", - "pytest-cov>=5.0", - "ruff>=0.6.3", - "pyright>=1.1.378", - "mypy>=1.11.1", - "sourcery>=1.22", - "pre-commit>=3.8", - "Sphinx>=8.0", - "sphinx-argparse-cli>=1.17", - "sphinx-autodoc-typehints>=2.2", - "sphinxcontrib-mermaid>=1.0.0", - "myst-parser>=4.0", - "furo>=2024.8", + "pytest>=8.3", + "pytest-cov>=5.0", + "ruff>=0.6.3", + "pyright>=1.1.378", + "mypy>=1.11.1", + "sourcery>=1.22", + "pre-commit>=3.8", + "Sphinx>=8.0", + "sphinx-argparse-cli>=1.17", + "sphinx-autodoc-typehints>=2.2", + "sphinxcontrib-mermaid>=1.0.0", + "myst-parser>=4.0", + "furo>=2024.8", ] native-tls = true - [project.scripts] -publish-interface-docs = "mlfmu.cli.publish_docs:main" mlfmu = "mlfmu.cli.mlfmu:main" - +publish-interface-docs = "mlfmu.cli.publish_docs:main" [tool.mypy] -plugins = [ - "numpy.typing.mypy_plugin", -] -mypy_path = "stubs" -files = [ - "src", - "tests", +check_untyped_defs = true +disable_error_code = [ + "misc", + "import-untyped", ] exclude = [ - "^src/mlfmu/fmu_build/cppfmu/", + "^src/mlfmu/fmu_build/cppfmu/", ] -check_untyped_defs = true -disable_error_code = [ - "misc", - "import-untyped", +files = [ + "src", + "tests", +] +mypy_path = "stubs" +plugins = [ + "numpy.typing.mypy_plugin", ] - [tool.pyright] -stubPath = "stubs" -include = [ - "src", - "tests", - "examples", -] exclude = [ - "src/mlfmu/fmu_build/cppfmu", + "src/mlfmu/fmu_build/cppfmu", ] +include = [ + "src", + "tests", + "examples", +] +stubPath = "stubs" -typeCheckingMode = "basic" -useLibraryCodeForTypes = true -reportMissingParameterType = "error" -reportUnknownParameterType = "warning" -reportUnknownMemberType = "warning" # consider to set to `false` if you work a lot with matplotlib and pandas, which are both not properly typed and known to trigger this warning -reportMissingTypeArgument = "error" -reportPropertyTypeMismatch = "error" -reportFunctionMemberAccess = "warning" -reportPrivateUsage = "warning" -reportTypeCommentUsage = "warning" -reportIncompatibleMethodOverride = "warning" -reportIncompatibleVariableOverride = "error" -reportInconsistentConstructor = "error" -reportOverlappingOverload = "warning" -reportUninitializedInstanceVariable = "warning" -reportCallInDefaultInitializer = "warning" -reportUnnecessaryIsInstance = "information" -reportUnnecessaryCast = "warning" -reportUnnecessaryComparison = "warning" -reportUnnecessaryContains = "warning" -reportUnusedCallResult = "warning" -reportUnusedExpression = "warning" -reportMatchNotExhaustive = "warning" -reportShadowedImports = "warning" -reportUntypedFunctionDecorator = "warning" -reportUntypedClassDecorator = "warning" -reportUntypedBaseClass = "error" -reportUntypedNamedTuple = "warning" -reportUnnecessaryTypeIgnoreComment = "information" +reportCallInDefaultInitializer = "warning" +reportFunctionMemberAccess = "warning" +reportIncompatibleMethodOverride = "warning" +reportIncompatibleVariableOverride = "error" +reportInconsistentConstructor = "error" +reportMatchNotExhaustive = "warning" +reportMissingParameterType = "error" +reportMissingTypeArgument = "error" +reportOverlappingOverload = "warning" +reportPrivateUsage = "warning" +reportPropertyTypeMismatch = "error" +reportShadowedImports = "warning" +reportTypeCommentUsage = "warning" +reportUninitializedInstanceVariable = "warning" +reportUnknownMemberType = "warning" # consider to set to `false` if you work a lot with matplotlib and pandas, which are both not properly typed and known to trigger this warning +reportUnknownParameterType = "warning" +reportUnnecessaryCast = "warning" +reportUnnecessaryComparison = "warning" +reportUnnecessaryContains = "warning" +reportUnnecessaryIsInstance = "information" +reportUnnecessaryTypeIgnoreComment = "information" +reportUntypedBaseClass = "error" +reportUntypedClassDecorator = "warning" +reportUntypedFunctionDecorator = "warning" +reportUntypedNamedTuple = "warning" +reportUnusedCallResult = "warning" +reportUnusedExpression = "warning" +typeCheckingMode = "basic" +useLibraryCodeForTypes = true # Activate the following rules only locally and temporary, i.e. for a QA session. # (For server side CI they are considered too strict.) # reportMissingTypeStubs = true From 799c64b05ef55fc22bfc99871a65438859d33949 Mon Sep 17 00:00:00 2001 From: Kristoffer Skare Date: Mon, 16 Jun 2025 11:16:39 +0200 Subject: [PATCH 2/3] Undo unnesessary format changes to pyproject.toml --- pyproject.toml | 220 +++++++++++++++++++++++++------------------------ 1 file changed, 113 insertions(+), 107 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61f3145..ee731c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,152 +1,158 @@ [build-system] -build-backend = "hatchling.build" requires = [ - "hatchling", + "hatchling", ] +build-backend = "hatchling.build" [tool.hatch.build.targets.sdist] only-include = [ - "src/mlfmu", - "tests", - ".coveragerc", - ".editorconfig", - "pytest.ini", - "ruff.toml", - "uv.lock", + "src/mlfmu", + "tests", + ".coveragerc", + ".editorconfig", + "pytest.ini", + "ruff.toml", + "uv.lock", ] [tool.hatch.build.targets.wheel] packages = [ - "src/mlfmu", + "src/mlfmu", ] [project] +name = "mlfmu" +version = "1.0.3" +description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)" +readme = "README.md" +requires-python = ">= 3.10" +license = { file = "LICENSE" } authors = [ - {name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com"}, - {name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com"}, + { name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com" }, + { name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com" }, +] +maintainers = [ + { name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com" }, + { name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com" }, + { name = "Hee Jong Park", email = "hee.jong.park@dnv.com" }, + { name = "Claas Rostock", email = "claas.rostock@dnv.com" }, +] +keywords = [ ] classifiers = [ - "Development Status :: 3 - Alpha", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", # "Operating System :: MacOS", - "Environment :: Console", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering", - "Topic :: Software Development :: Libraries :: Python Modules", + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + # "Operating System :: MacOS", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ - "dictIO>=0.3.4", - "pydantic>=2.6", - "json-schema-for-humans>=0.4.7", - "onnxruntime==1.18.1", - "conan>=2.1", -] -description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)" -keywords = [] -license = {file = "LICENSE"} -maintainers = [ - {name = "Kristoffer Skare", email = "kristoffer.skare@dnv.com"}, - {name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com"}, - {name = "Hee Jong Park", email = "hee.jong.park@dnv.com"}, - {name = "Claas Rostock", email = "claas.rostock@dnv.com"}, + "dictIO>=0.3.4", + "pydantic>=2.6", + "json-schema-for-humans>=0.4.7", + "onnxruntime==1.18.1", + "conan>=2.1", ] -name = "mlfmu" -readme = "README.md" -requires-python = ">= 3.10" -version = "1.0.3" [project.urls] -Changelog = "https://github.com/dnv-opensource/mlfmu/blob/main/CHANGELOG.md" -Documentation = "https://dnv-opensource.github.io/mlfmu/README.html" Homepage = "https://github.com/dnv-opensource/mlfmu" -Issues = "https://github.com/dnv-opensource/mlfmu/issues" +Documentation = "https://dnv-opensource.github.io/mlfmu/README.html" Repository = "https://github.com/dnv-opensource/mlfmu.git" +Issues = "https://github.com/dnv-opensource/mlfmu/issues" +Changelog = "https://github.com/dnv-opensource/mlfmu/blob/main/CHANGELOG.md" + [tool.uv] dev-dependencies = [ - "pytest>=8.3", - "pytest-cov>=5.0", - "ruff>=0.6.3", - "pyright>=1.1.378", - "mypy>=1.11.1", - "sourcery>=1.22", - "pre-commit>=3.8", - "Sphinx>=8.0", - "sphinx-argparse-cli>=1.17", - "sphinx-autodoc-typehints>=2.2", - "sphinxcontrib-mermaid>=1.0.0", - "myst-parser>=4.0", - "furo>=2024.8", + "pytest>=8.3", + "pytest-cov>=5.0", + "ruff>=0.6.3", + "pyright>=1.1.378", + "mypy>=1.11.1", + "sourcery>=1.22", + "pre-commit>=3.8", + "Sphinx>=8.0", + "sphinx-argparse-cli>=1.17", + "sphinx-autodoc-typehints>=2.2", + "sphinxcontrib-mermaid>=1.0.0", + "myst-parser>=4.0", + "furo>=2024.8", ] native-tls = true + [project.scripts] -mlfmu = "mlfmu.cli.mlfmu:main" publish-interface-docs = "mlfmu.cli.publish_docs:main" +mlfmu = "mlfmu.cli.mlfmu:main" + [tool.mypy] -check_untyped_defs = true -disable_error_code = [ - "misc", - "import-untyped", -] -exclude = [ - "^src/mlfmu/fmu_build/cppfmu/", +plugins = [ + "numpy.typing.mypy_plugin", ] +mypy_path = "stubs" files = [ - "src", - "tests", + "src", + "tests", ] -mypy_path = "stubs" -plugins = [ - "numpy.typing.mypy_plugin", +exclude = [ + "^src/mlfmu/fmu_build/cppfmu/", +] +check_untyped_defs = true +disable_error_code = [ + "misc", + "import-untyped", ] + [tool.pyright] -exclude = [ - "src/mlfmu/fmu_build/cppfmu", -] +stubPath = "stubs" include = [ - "src", - "tests", - "examples", + "src", + "tests", + "examples", +] +exclude = [ + "src/mlfmu/fmu_build/cppfmu", ] -stubPath = "stubs" -reportCallInDefaultInitializer = "warning" -reportFunctionMemberAccess = "warning" -reportIncompatibleMethodOverride = "warning" -reportIncompatibleVariableOverride = "error" -reportInconsistentConstructor = "error" -reportMatchNotExhaustive = "warning" -reportMissingParameterType = "error" -reportMissingTypeArgument = "error" -reportOverlappingOverload = "warning" -reportPrivateUsage = "warning" -reportPropertyTypeMismatch = "error" -reportShadowedImports = "warning" -reportTypeCommentUsage = "warning" -reportUninitializedInstanceVariable = "warning" -reportUnknownMemberType = "warning" # consider to set to `false` if you work a lot with matplotlib and pandas, which are both not properly typed and known to trigger this warning -reportUnknownParameterType = "warning" -reportUnnecessaryCast = "warning" -reportUnnecessaryComparison = "warning" -reportUnnecessaryContains = "warning" -reportUnnecessaryIsInstance = "information" -reportUnnecessaryTypeIgnoreComment = "information" -reportUntypedBaseClass = "error" -reportUntypedClassDecorator = "warning" -reportUntypedFunctionDecorator = "warning" -reportUntypedNamedTuple = "warning" -reportUnusedCallResult = "warning" -reportUnusedExpression = "warning" -typeCheckingMode = "basic" -useLibraryCodeForTypes = true +typeCheckingMode = "basic" +useLibraryCodeForTypes = true +reportMissingParameterType = "error" +reportUnknownParameterType = "warning" +reportUnknownMemberType = "warning" # consider to set to `false` if you work a lot with matplotlib and pandas, which are both not properly typed and known to trigger this warning +reportMissingTypeArgument = "error" +reportPropertyTypeMismatch = "error" +reportFunctionMemberAccess = "warning" +reportPrivateUsage = "warning" +reportTypeCommentUsage = "warning" +reportIncompatibleMethodOverride = "warning" +reportIncompatibleVariableOverride = "error" +reportInconsistentConstructor = "error" +reportOverlappingOverload = "warning" +reportUninitializedInstanceVariable = "warning" +reportCallInDefaultInitializer = "warning" +reportUnnecessaryIsInstance = "information" +reportUnnecessaryCast = "warning" +reportUnnecessaryComparison = "warning" +reportUnnecessaryContains = "warning" +reportUnusedCallResult = "warning" +reportUnusedExpression = "warning" +reportMatchNotExhaustive = "warning" +reportShadowedImports = "warning" +reportUntypedFunctionDecorator = "warning" +reportUntypedClassDecorator = "warning" +reportUntypedBaseClass = "error" +reportUntypedNamedTuple = "warning" +reportUnnecessaryTypeIgnoreComment = "information" # Activate the following rules only locally and temporary, i.e. for a QA session. # (For server side CI they are considered too strict.) # reportMissingTypeStubs = true From ffcce13c5ec8f01f46ccda587bb8400671b37565 Mon Sep 17 00:00:00 2001 From: Kristoffer Skare Date: Mon, 16 Jun 2025 11:31:05 +0200 Subject: [PATCH 3/3] Restrict python version to less than 3.13 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ee731c2..801094f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ name = "mlfmu" version = "1.0.3" description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)" readme = "README.md" -requires-python = ">= 3.10" +requires-python = ">= 3.10,<3.13" license = { file = "LICENSE" } authors = [ { name = "Jorge Luis Mendez", email = "jorge.luis.mendez@dnv.com" },