-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from fabian-sp/best-practices-2
Apply Scientific Python best practices
- Loading branch information
Showing
19 changed files
with
765 additions
and
505 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.0 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "ncopt" | ||
dynamic = ["version"] | ||
description = 'This repository contains a Python implementation of the SQP-GS (Sequential Quadratic Programming - Gradient Sampling) algorithm by Curtis and Overton.' | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
license = "BSD-3-Clause" | ||
keywords = [] | ||
authors = [ | ||
{ name = "fabian-sp", email = "fabian.schaipp@gmail.com" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"numpy", | ||
"torch", | ||
"cvxopt", | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/fabian-sp/ncOPT#readme" | ||
Issues = "https://github.com/fabian-sp/ncOPT/issues" | ||
Source = "https://github.com/fabian-sp/ncOPT" | ||
|
||
[tool.hatch.version] | ||
path = "src/ncopt/__about__.py" | ||
|
||
[tool.hatch.envs.default] | ||
dependencies = [ | ||
"coverage[toml]>=6.5", | ||
"pytest", | ||
"matplotlib", | ||
] | ||
|
||
[tool.hatch.envs.default.scripts] | ||
test = "pytest {args:tests}" | ||
test-cov = "coverage run -m pytest {args:tests}" | ||
cov-report = [ | ||
"- coverage combine", | ||
"coverage report", | ||
] | ||
cov = [ | ||
"test-cov", | ||
"cov-report", | ||
] | ||
|
||
[[tool.hatch.envs.all.matrix]] | ||
python = ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
[tool.hatch.envs.types] | ||
dependencies = [ | ||
"mypy>=1.0.0", | ||
] | ||
[tool.hatch.envs.types.scripts] | ||
check = "mypy --install-types --non-interactive {args:src/ncopt tests}" | ||
|
||
[tool.coverage.run] | ||
source_pkgs = ["ncopt", "tests"] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"src/ncopt/__about__.py", | ||
] | ||
|
||
[tool.coverage.paths] | ||
ncopt = ["src/ncopt", "*/ncopt/src/ncopt"] | ||
tests = ["tests", "*/ncopt/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
] | ||
|
||
[tool.ruff] | ||
lint.select = [ | ||
"E", | ||
"F", | ||
"I", | ||
"NPY201", | ||
"W605", # Check for invalid escape sequences in docstrings (errors in py >= 3.11) | ||
] | ||
lint.ignore = [ | ||
"E741", # ambiguous variable name | ||
] | ||
line-length = 100 | ||
|
||
# The minimum Python version that should be supported | ||
target-version = "py39" | ||
|
||
src = ["src"] |
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.