Skip to content

Commit 014915f

Browse files
authored
Merge pull request #17 from Adamtaranto/packageify
Packageify & Migrate to Py3
2 parents 925b04a + d2e7aee commit 014915f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6774
-20191
lines changed

.github/workflows/pytest.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Python Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
12+
13+
steps:
14+
# Checkout the latest commit associated with the PR
15+
- uses: actions/checkout@v4
16+
17+
- name: Debug matrix value
18+
run: echo "Python version is ${{ matrix.python-version }}"
19+
20+
# Set up Miniconda
21+
- name: Set up Miniconda
22+
uses: conda-incubator/setup-miniconda@v2
23+
with:
24+
auto-update-conda: true # Optional: update Conda to the latest version
25+
python-version: ${{ matrix.python-version }}
26+
27+
# Install any additional dependencies not included in the pyproject.toml file
28+
- name: Install additional dependencies
29+
run: |
30+
pip install '.[tests]' # Install all dependencies, including test-specific ones
31+
shell: bash -l {0}
32+
33+
# Run pytest on the specified directory
34+
- name: Run tests
35+
run: |
36+
pytest tests
37+
shell: bash -l {0}

.github/workflows/ruff.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Ruff Formatting
2+
on: [pull_request]
3+
jobs:
4+
ruff:
5+
if: ${{ github.actor != 'dependabot[bot]' }} # Do not run on commits created by dependabot
6+
runs-on: ubuntu-latest
7+
permissions:
8+
# Give the default GITHUB_TOKEN write permission to commit and push the changed files.
9+
contents: write # Allows reading and writing repository contents (e.g., commits)
10+
pull-requests: write # Allows reading and writing pull requests
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.sha }}
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
- uses: chartboost/ruff-action@v1
17+
with:
18+
src: './src/flexidot'
19+
args: 'format --target-version py310'
20+
- uses: stefanzweifel/git-auto-commit-action@v5
21+
id: auto-commit-action
22+
with:
23+
commit_message: 'Style fixes by Ruff'

.gitignore

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Mac stuff
2+
.DS_Store
3+
4+
# Versioning
5+
src/flexidot/_version.py
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
env/
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
.hypothesis/
54+
55+
# Jupyter Notebook
56+
.ipynb_checkpoints
57+
58+
# pyenv
59+
.python-version
60+
61+
# dotenv
62+
.env
63+
64+
# virtualenv
65+
.venv
66+
venv/
67+
ENV/
68+
69+
# mypy
70+
.mypy_cache/

code/README.md renamed to CHANGELOG.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
# FlexiDot version changes
22

3-
![alt text](https://github.com/molbio-dresden/flexidot/blob/master/images/Selfdotplots_banner4.png "FlexiDot self dotplots")
3+
![alt text](https://github.com/molbio-dresden/flexidot/blob/master/docs/images/Selfdotplots_banner4.png "FlexiDot self dotplots")
4+
5+
## Version 2.0.0
6+
*Jan 2025*
7+
8+
This release is a major refactor of the Flexidot codebase that migrates to Python 3 and a modern package structure.
9+
10+
**[Faster run time]:**
11+
- When comparing a sequence to an identical sequence `find_match_pos_diag()` will recycle kmer counts from the first seq. Saves 33% runtime.
12+
13+
**[New features]:**
14+
15+
- Flexidot and its dependancies are now pip installable - uses Hatch and pyproject.toml
16+
- Versioning is now managed dynamically using git tags
17+
- Some basic tests for the core `find_match_pos_diag()` function have been added
18+
- cmd line options are now managed with argparse
19+
- Repo includes env yaml to set up conda env for flexidot
20+
- Check that input files exist
21+
- Auto cleanup temp files
22+
- Add action to run pytests
23+
- Add action to format code with Rust
24+
- Uses logging module to manage status logging (removed time logging)
25+
26+
**[Changed defaults]:**
27+
- Several cmd line options have been renamed or have changes to their expected input formatting. See --help.
28+
- If not using the `--wobble_conversion` option then kmers containing any Ns will be skipped by default.
29+
- If `--wobble_conversion` is set then `--max_n` determines the max percentage of Ns that will be tolerated in a kmer. Default changed to 10% from hard coded 49%.
30+
31+
**[Bugfixes]:**
32+
- Fix depreciation issue with numpy creating an ndarray from ragged nested sequences in `find_match_pos_diag()` Closes issue #15
33+
- Read files with r instead of rb
34+
- Fix unicode issue referenced in #10
35+
36+
<br>
437

538
## Version 1.06
639
*14.04.2019*

0 commit comments

Comments
 (0)