Skip to content

Commit

Permalink
Reorganize and Refactor POVME (#2)
Browse files Browse the repository at this point in the history
* refactor: Massive reorganization (broken)

* tests: Add basic povme tests

* docs: add start

* Fix docs title

* Fix docs code color

* Cleanup cli

* Reorganize some files

* Cleanup some test files

* Move pocket_id test info

* chore: fix mypy.ini

* tests: fix

* refactor: reorganize

* refactor: start migration to pydantic

* fix: get 4nss test running

* refactor: modular writing on POVME

* tests: Enable logging

* tests: cleanup

* refactor: fix pocket detection

* Cleanup docs
  • Loading branch information
aalexmmaldonado authored Nov 29, 2024
1 parent ab929dc commit 0b51725
Show file tree
Hide file tree
Showing 66 changed files with 12,106 additions and 5,175 deletions.
7 changes: 7 additions & 0 deletions .black.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.black]
target-version = [
"py312",
]
line-length = 88
color = true
exclude = "/(\n \\.git\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv\n | _build\n | buck-out\n | build\n | dist\n | env\n | venv\n)/\n"
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
branch = true
source = tests

[paths]
source = povme

[report]
show_missing = true
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Check http://editorconfig.org for more information

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.{py, pyi}]
indent_style = space
indent_size = 4

[*.bat]
indent_style = tab
end_of_line = crlf

[Makefile]
indent_style = tab

[*.{yml, yaml}]
indent_size = 2
trim_trailing_whitespace = true

[*.md]
indent_size = 4
trim_trailing_whitespace = true

[LICENSE]
insert_final_newline = false

[*.{diff,patch}]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
37 changes: 37 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Codecov workflow

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
run:
name: codecov
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true

- name: Install pixi
uses: prefix-dev/[email protected]

- name: Setup environment
run: pixi install

- name: Get test coverage
run: pixi run tests

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy documentation

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
name: docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pixi
uses: prefix-dev/[email protected]

- name: Setup environment
run: pixi install

- name: Build documentation
run: pixi run docs

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'public/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install pixi
uses: prefix-dev/[email protected]

- name: Setup environment
run: pixi install

- name: Run tests
run: pixi run tests
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
*.pyc
.DS_Store

# pixi environments
.pixi
*.egg-info

# Documentation
api
public

__pycache__
.vscode
9 changes: 9 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
py_version = 312
line_length = 88
known_typing = typing,types,typing_extensions,mypy,mypy_extensions
sections = FUTURE,TYPING,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
profile = black
include_trailing_comma = true
multi_line_output = 3
indent = 4
20 changes: 20 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
MD007:
indent: 4
MD013: false
MD022: false
MD024: false
MD026: false
MD028: false
MD030:
ol_multi: 2
ol_single: 2
ul_multi: 3
ul_single: 3
MD031: false
MD032: false
MD033: false
MD036: false
MD038: false
MD041: false
MD046: false
24 changes: 24 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[mypy]
python_version = 3.12
pretty = true
show_traceback = true
color_output = true
allow_redefinition = false
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
ignore_missing_imports = true
implicit_reexport = false
no_implicit_optional = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
exclude = (?x)(^public/*$)
23 changes: 23 additions & 0 deletions .pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[pytest]
norecursedirs =
povme
*.egg
.eggs
dist
build
docs
.tox
.git
__pycache__
doctest_optionflags =
NUMBER
NORMALIZE_WHITESPACE
IGNORE_EXCEPTION_DETAIL
addopts =
--strict-markers
--tb=short
--doctest-modules
--doctest-continue-on-failure
--maxfail=2 -rf
testpaths = tests
pythonpaths = ./
23 changes: 23 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
target-version = "py312"
line-length = 88
indent-width = 4
exclude = [
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"_build",
"buck-out",
"build",
"dist",
"env",
"venv",
]

[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
docstring-code-format = true
docstring-code-line-length = "dynamic"
44 changes: 22 additions & 22 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,58 @@ NOTE: There is a MP error in python3. Need to fix. Use 1 processor for now.
2.2.2
-----

1. Fixed text-encoding bug.
1. Fixed text-encoding bug.

2.2.1
-----

1. Made minor changes to the `README.md` file to clarify the
1. Made minor changes to the `README.md` file to clarify the
`ContiguousPointsCriteria`, `ContiguousPocketSeedSphere`, and
`ContiguousPocketSeedBox` parameters.
2. Otherwise identical to POVME 2.2.
2. Otherwise identical to POVME 2.2.

2.2
---

1. Updated version to 2.2.
2. Fixed an error that prevented POVME from saving its output to uncompressed
1. Updated version to 2.2.
2. Fixed an error that prevented POVME from saving its output to uncompressed
files. (Previously only writing output to compressed output succeeded.)
3. POVME now throws a warning when using Python 3.5 or earlier.
4. When the user does not specify any contiguous-pocket seed regions, POVME no
3. POVME now throws a warning when using Python 3.5 or earlier.
4. When the user does not specify any contiguous-pocket seed regions, POVME no
longer outputs the default value of the ContiguousPointsCriteria parameter
to the screen. In this case, POVME does not use the
ContiguousPointsCriteria parameter anyway, so outputing its value to the
screen only causes confusion.
5. Applied [Black formatter](https://black.readthedocs.io/en/stable/) to all
5. Applied [Black formatter](https://black.readthedocs.io/en/stable/) to all
Python code.

2.1
---

1. Updated version to 2.1.
2. Now Python3 compatible. Python2 no longer officially supported.
3. Refactored code so that it can now be called as a library.
4. Moved GUI wrapper to new `depreciated/` folder. This feature is no longer
1. Updated version to 2.1.
2. Now Python3 compatible. Python2 no longer officially supported.
3. Refactored code so that it can now be called as a library.
4. Moved GUI wrapper to new `depreciated/` folder. This feature is no longer
supported.
5. Improved formatting (black) and docstrings.
6. Fixed minor bug that assigned atoms with names like "HG21" to element "HG"
5. Improved formatting (black) and docstrings.
6. Fixed minor bug that assigned atoms with names like "HG21" to element "HG"
rather than "H". No longer supporting element "HG".
7. Moved examples directory to `povme/examples/`.
8. Can now read both Windows and POSIX path names seamlessly (no need for
7. Moved examples directory to `povme/examples/`.
8. Can now read both Windows and POSIX path names seamlessly (no need for
separate ini files).
9. Easy testing now available: `python POVME2.py --test` and `python
9. Easy testing now available: `python POVME2.py --test` and `python
POVME_pocket_id.py --test`
10. Added project roadmap.
10. Added project roadmap.

2.0.3
-----

1. Updated citation.
2. Convex hull now calculated based on locations of all heavy atoms. In 2.0.1,
1. Updated citation.
2. Convex hull now calculated based on locations of all heavy atoms. In 2.0.1,
it was all alpha carbons. Take care when comparing POVME 2.0.1 and POVME
2.0.2/2.0.3 output.
3. Fixed NumPy warning.
4. Spelling error ("Angstroms").
3. Fixed NumPy warning.
4. Spelling error ("Angstroms").

2.0.1
-----
Expand Down
Loading

0 comments on commit 0b51725

Please sign in to comment.