Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 161 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,162 @@
/out
/venv
*.DS_Store
**/__pycache__/
!/src/dtpo/lib

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# setuptools_scm
src/*/_version.py


# ruff
.ruff_cache/

# OS specific stuff
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Common editor files
*~
*.swp

# Hatch-vcs version file
_version.py

# VSCode
.vscode/
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# dtpo
::: dtpo
show_root: true(base)
15 changes: 15 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
site_name: Documentation

nav:
- Home: index.md

theme: material

plugins:
- autorefs:
resolve_closest: true
- mkdocstrings:
handlers:
python:
options:
show_submodules: true
186 changes: 186 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
[project]
name = "dtpo"
version = "0.1.0"
authors = [
{ name = "Daniel Vos", email = "d.a.vos@tudelft.nl" },
]
description = "Interpretable reinforcement learning using policy gradients to optimize decision trees"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"absl-py==2.1.0",
"black==23.12.1",
"chex==0.1.85",
"click==8.1.7",
"cloudpickle==3.0.0",
"contourpy==1.2.0",
"cycler==0.12.1",
"decorator==5.1.1",
"distrax==0.1.5",
"dm-env==1.6",
"dm-tree==0.1.8",
"etils==1.5.2",
"farama-notifications==0.0.4",
"filelock==3.13.1",
"flax==0.7.5",
"fonttools==4.47.2",
"fsspec==2023.12.2",
"gast==0.5.4",
"gym==0.26.2",
"gym-notices==0.0.8",
"gymnasium==0.29.1",
"gymnax==0.0.6",
"importlib-metadata==7.0.1",
"importlib-resources==6.1.1",
"jax==0.4.23",
"jaxlib==0.4.23",
"jinja2==3.1.3",
"joblib==1.3.2",
"kiwisolver==1.4.5",
"markdown-it-py==3.0.0",
"markupsafe==2.1.4",
"matplotlib==3.8.2",
"mdurl==0.1.2",
"ml-dtypes==0.3.2",
"mpmath==1.3.0",
"msgpack==1.0.7",
"mypy-extensions==1.0.0",
"nest-asyncio==1.6.0",
"networkx==3.2.1",
"numpy==1.26.3",
"opt-einsum==3.3.0",
"optax==0.1.8",
"orbax-checkpoint==0.5.0",
"packaging==23.2",
"pandas==2.2.0",
"pathspec==0.12.1",
"pillow==10.2.0",
"platformdirs==4.1.0",
"protobuf==4.25.2",
"pydot==2.0.0",
"pygments==2.17.2",
"pyparsing==3.1.1",
"python-dateutil==2.8.2",
"pytz==2023.3.post1",
"pyyaml==6.0.1",
"rich==13.7.0",
"rlax==0.1.6",
"scikit-learn==1.2.2",
"scipy==1.12.0",
"seaborn==0.13.1",
"six==1.16.0",
"stable-baselines3==2.2.1",
"sympy==1.12",
"tensorflow-probability==0.23.0",
"tensorstore==0.1.52",
"threadpoolctl==3.2.0",
"tomli==2.0.1",
"toolz==0.12.0",
"torch==2.1.2",
"tqdm==4.66.1",
"typing-extensions==4.9.0",
"tzdata==2023.4",
"zipp==3.17.0",
]

[dependency-groups]
dev = [
"hatch>=1.13.0,<2",
"pre-commit>=3.8.0,<4",
"pytest>=8.3.3,<9",
"pytest-cov>=5.0.0,<6",
"mkdocstrings[python]>=0.26.1,<1",
"mkdocs-material>=9.5.39,<10",
"setuptools-scm>=8.1.0,<9",
"pyinstaller>=6.16.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/dtpo"]

[project.urls]
Homepage = "https://github.com/tudelft-cda-lab/DTPO"

[project.scripts]
dtpo = "dtpo.run_dtpo:main"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = [
"error",
]
log_cli_level = "INFO"
testpaths = [
"tests",
]

[tool.coverage]
run.source = ["boswachter"]
port.exclude_lines = [
'pragma: no cover',
'\.\.\.',
'if typing.TYPE_CHECKING:',
]

[tool.ruff]
src = ["src"]
exclude = []
line-length = 120 # how long you want lines to be

[tool.ruff.format]
docstring-code-format = true # code snippets in docstrings will be formatted

[tool.ruff.lint]
# For more strict linting and code simplifications, replace this with
# https://github.com/NLeSC/python-template/blob/main/template/pyproject.toml.jinja#L121-L136
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
# "D", # pydocstyle, uncomment to have the docstrings linted
# "ANN", # flake8-annotations, uncomment to have type hint annotations linted
]
ignore = [
"PLR", # Design related pylint codes
"ISC001", # Conflicts with formatter
"SIM108", # Ternary operator is rarely nicer
]
pydocstyle.convention = "google"

[tool.ruff.lint.per-file-ignores]
# Tests can ignore a few extra rules
"tests/**.py" = [
"ANN201", # Missing return type annotation for public function
"D103", # Missing docstring
"S101", # Use of assert is detected
"INP001", # Missing __init__.py file
]

[tool.yamlfix]
line_length = 120
sequence_style = "keep_style"
explicit_start = false
whitelines = 1
section_whitelines = 1
Loading