Skip to content

Commit

Permalink
docs work
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasturcani committed May 29, 2024
1 parent 8a896ba commit 25d31fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
src/omlt/_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Installation
==============
============

OMLT requires Python >= 3.6. The most stable OMLT version can be installed using the PyPI package index. This will also install the required depencies. Simply run: ::

Expand All @@ -13,7 +13,7 @@ If using the latest un-released version, install from the github repository and


Optional Requirements
-------------
---------------------

OMLT can import sequential Keras models which requires a working installation of tensorflow: ::

Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"onnx",
"onnxruntime",
]
requires-python = ">=3.7"
requires-python = ">=3.9"
dynamic = ["version"]
readme = "README.rst"
license = { file = "LICENSE.rst" }
Expand Down Expand Up @@ -45,18 +45,18 @@ dev-tools = [
"torchvision",
"tf2onnx",
]
dev = [
"omlt[dev-tools,keras,torch,linear-tree]",
]
dev-gpu = [
"omlt[dev-tools,keras-gpu,torch,linear-tree]",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
"tensorflow",
"linear-tree",
]
dev = [
"omlt[dev-tools,keras,torch,linear-tree,docs]",
]
dev-gpu = [
"omlt[dev-tools,keras-gpu,torch,linear-tree,docs]",
]


[project.urls]
Expand All @@ -65,6 +65,7 @@ x = "https://x.com/cogimperial"
documentation = "https://omlt.readthedocs.io"

[tool.setuptools_scm]
write_to = "src/omlt/_version.py"

[tool.ruff]
line-length = 88
Expand Down
27 changes: 7 additions & 20 deletions src/omlt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,12 @@
"""

import sys

if sys.version_info[:2] >= (3, 8):
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
from importlib.metadata import PackageNotFoundError # pragma: no cover
from importlib.metadata import version
else:
from importlib_metadata import PackageNotFoundError # pragma: no cover
from importlib_metadata import version

try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = version(dist_name)
except PackageNotFoundError: # pragma: no cover
__version__ = "unknown"
finally:
del version, PackageNotFoundError

# Top level exports
from omlt._version import __version__
from omlt.block import OmltBlock
from omlt.scaling import OffsetScaling

__all__ = [
"OmltBlock",
"OffsetScaling",
"__version__",
]

0 comments on commit 25d31fe

Please sign in to comment.