Skip to content

Commit 2df3009

Browse files
committed
Merge branch 'release/0.18.3'
2 parents 8c1faca + 931161e commit 2df3009

45 files changed

Lines changed: 320 additions & 490 deletions

Some content is hidden

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

.rtd-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- configparser
1313
- diskcache
1414
- feather-format
15-
- genomepy >=0.16.3 # has no dependency on pkg_resources
15+
- genomepy >=0.16.4 # has no dependency on pkg_resources
1616
- iteround
1717
- jinja2
1818
- logomaker

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,36 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

6+
7+
68
## Unreleased
79

810

911

12+
## [0.18.3] - 2026-06-09
13+
14+
### Added
15+
16+
- `gimme motifs` & `gimme maelstrom` now accept argument `--noprogress` to silence tqdm progress bars
17+
18+
### Changed
19+
20+
- minor Scanner.set_threshold optimization
21+
22+
### Fixed
23+
24+
- Scanner.scan now returns sequence.ids along with results.
25+
- if sequences cannot be parsed, both ids and results are omitted.
26+
27+
### Removed
28+
29+
- deprecated functions `pwm_scan` and `pwm_scan_all`
30+
- warning blacklists
31+
- unused functions `_moap_with_bg()` and `_moap_with_table()`
32+
- outdated copyright comments (copyright claims still found in docs and COPYING file)
33+
34+
35+
1036
## [0.18.2] - 2026-04-03
1137

1238
### Changed
@@ -507,6 +533,7 @@ manage your genomes.
507533

508534

509535
[Unreleased]: https://github.com/vanheeringen-lab/gimmemotifs/compare/master...develop
536+
[0.18.3]: https://github.com/vanheeringen-lab/gimmemotifs/compare/0.18.2...0.18.3
510537
[0.18.2]: https://github.com/vanheeringen-lab/gimmemotifs/compare/0.18.1...0.18.2
511538
[0.18.1]: https://github.com/vanheeringen-lab/gimmemotifs/compare/0.18.0...0.18.1
512539
[0.18.0]: https://github.com/vanheeringen-lab/gimmemotifs/compare/0.17.0...0.18.0

docs/release_checklist.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ This is mainly for personal use at the moment.
55
## 0. (Re)install gimmemotifs
66

77
```shell
8-
mamba activate base
9-
mamba env create --force -n gimme -f requirements.yaml
10-
mamba activate gimme
8+
conda activate base
9+
conda env remove -n gimme -yq
10+
mamba env create -n gimme -f requirements.yaml
11+
conda activate gimme
1112
pip install --no-deps --no-cache-dir --use-pep517 -v -e .
13+
1214
```
1315

1416
## 1. Make sure all tests pass.
@@ -17,6 +19,7 @@ pip install --no-deps --no-cache-dir --use-pep517 -v -e .
1719
rm ~/.config/gimmemotifs/gimmemotifs.cfg
1820
gimme -h
1921
pytest -vvv --disable-pytest-warnings
22+
2023
```
2124

2225
## 2. Create release candidate with `git flow`:
@@ -26,6 +29,7 @@ new_version=0.0.0
2629
echo ${new_version}
2730

2831
git flow release start ${new_version}
32+
2933
```
3034

3135
## 3. Make sure `__about__.py`, `pyproject.toml`, `CHANGELOG.md` are up-to-date.
@@ -39,9 +43,11 @@ git flow release start ${new_version}
3943
## 4. Test install using pip in fresh conda environment
4044

4145
```shell
46+
rm -rf dist
4247
pip wheel -w dist --no-deps --no-cache-dir --use-pep517 -v .
48+
conda env remove -n test -yq
4349
mamba env create --force -n test -f requirements.yaml
44-
mamba activate test
50+
conda activate test
4551
pip install --no-deps --no-cache-dir --use-pep517 -v dist/gimmemotifs*.whl
4652

4753
rm ~/.config/gimmemotifs/gimmemotifs.cfg
@@ -54,20 +60,21 @@ pytest -vvv --disable-pytest-warnings
5460

5561
For more info, see https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives
5662

57-
```
63+
```shell
5864
# Create the source distribution
59-
$ python3 -m pip install --upgrade build
60-
$ python3 -m build
65+
python3 -m pip install --upgrade build
66+
python3 -m build
6167

6268
# Test the source distribution
63-
$ pip install --no-deps --no-cache-dir --use-pep517 -v dist/gimmemotifs*.tar.gz
64-
$ rm ~/.config/gimmemotifs/gimmemotifs.cfg
65-
$ gimme -h
66-
$ pytest -vvv --disable-pytest-warnings
69+
pip install --no-deps --no-cache-dir --use-pep517 -v dist/gimmemotifs*.tar.gz
70+
rm ~/.config/gimmemotifs/gimmemotifs.cfg
71+
gimme -h
72+
pytest -vvv --disable-pytest-warnings
6773

6874
# Upload to pypi testing server
69-
$ python3 -m pip install --upgrade twine
70-
$ python3 -m twine upload --repository testpypi dist/*
75+
python3 -m pip install --upgrade twine
76+
python3 -m twine upload --repository testpypi dist/*
77+
7178
```
7279

7380
## 6. Finish release

gimmemotifs/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.18.2"
1+
__version__ = "0.18.3"

gimmemotifs/__init__.py

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
import atexit as _atexit
22
import logging as _logging
3-
import warnings as _warnings
43
from os import getpid as _getpid
54
from shutil import rmtree as _rmtree
65
from tempfile import mkdtemp as _mkdtemp
7-
from warnings import warn as _warn
86

9-
from .__about__ import __version__
10-
11-
12-
def _filtered_warn(*args, **kwargs):
13-
"""warnings.filterwarnings does not work."""
14-
blacklist = [
15-
# maelstrom sklearn SVM
16-
"Liblinear failed to converge, increase the number of iterations.",
17-
# report.py (pandas internal DeprecationWarning)
18-
"The get_cmap function will be deprecated in a future version. "
19-
"Use ``matplotlib.colormaps[name]`` or "
20-
"``matplotlib.colormaps.get_cmap(obj)`` instead.",
21-
# report.py pandas FutureWarning, alternative works differently
22-
"this method is deprecated in favour of `Styler.to_html()`",
23-
# scanner/base.py set_threshold
24-
"DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, "
25-
"which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. "
26-
"To get a de-fragmented frame, use `newframe = frame.copy()`",
27-
]
28-
message = str(args[0])
29-
if message in blacklist:
30-
pass
31-
else:
32-
_warn(*args, **kwargs)
7+
from loguru import logger as _loguru_logger
338

9+
from .__about__ import __version__
3410

35-
_warnings.warn = _filtered_warn
11+
# import warnings as _warnings
12+
# def _filtered_warn(*args, **kwargs):
13+
# """warnings.filterwarnings does not work."""
14+
# blacklist = [
15+
# # maelstrom sklearn SVM
16+
# "Liblinear failed to converge, increase the number of iterations.",
17+
# # report.py (pandas internal DeprecationWarning)
18+
# "The get_cmap function will be deprecated in a future version. "
19+
# "Use ``matplotlib.colormaps[name]`` or "
20+
# "``matplotlib.colormaps.get_cmap(obj)`` instead.",
21+
# # report.py pandas FutureWarning, alternative works differently
22+
# "this method is deprecated in favour of `Styler.to_html()`",
23+
# # scanner/base.py set_threshold
24+
# "DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, "
25+
# "which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. "
26+
# "To get a de-fragmented frame, use `newframe = frame.copy()`",
27+
# ]
28+
# message = str(args[0])
29+
# if message in blacklist:
30+
# pass
31+
# else:
32+
# _warnings.warn(*args, **kwargs)
33+
#
34+
#
35+
# _warnings.warn = _filtered_warn
3636

3737

3838
def mytmpdir():
@@ -44,24 +44,26 @@ def mytmpdir():
4444

4545
# setup logger
4646
logger = _logging.getLogger("gimme")
47-
if logger.hasHandlers():
48-
logger.handlers.clear()
49-
47+
logger.handlers.clear()
5048
logger.setLevel(_logging.DEBUG)
49+
logger.propagate = False
5150

52-
# nice format
53-
screen_formatter = _logging.Formatter(
51+
_screen_formatter = _logging.Formatter(
5452
"%(asctime)s - %(levelname)s - %(message)s", "%H:%M:%S"
5553
)
54+
_sh = _logging.StreamHandler()
55+
_sh.setLevel(_logging.INFO)
56+
_sh.setFormatter(_screen_formatter)
57+
logger.addHandler(_sh)
58+
59+
# bridge Loguru
60+
class _PropagateHandler(_logging.Handler):
61+
def emit(self, record):
62+
_logging.getLogger("gimme").handle(record)
5663

57-
# log to screen
58-
sh = _logging.StreamHandler()
59-
sh.setLevel(_logging.INFO)
60-
sh.setFormatter(screen_formatter)
61-
logger.addHandler(sh)
62-
del screen_formatter
63-
del sh
6464

65+
_loguru_logger.remove()
66+
_loguru_logger.add(_PropagateHandler(), format="{message}")
6567

6668
# import submodules to enable module autocomplete in editor
6769

gimmemotifs/background.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Copyright (c) 2009-2019 Simon van Heeringen <simon.vanheeringen@gmail.com>
2-
#
3-
# This module is free software. You can redistribute it and/or modify it under
4-
# the terms of the MIT License, see the file COPYING included with this
5-
# distribution.
6-
71
"""
82
Classes to generate background files in FASTA format. Two different methods are
93
included: MarkovFasta, which generates a background according to a 1st order

gimmemotifs/c_metrics.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2019 Simon van Heeringen <simon.vanheeringen@gmail.com>
3-
*
4-
* This module is free software. You can redistribute it and/or modify it under
5-
* the terms of the MIT License, see the file COPYING included with this
6-
* distribution.
7-
*
82
* This module contains all the code to compare motifs
9-
*
103
*/
114

125
#include <Python.h>

gimmemotifs/cli.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/usr/bin/env python
2-
# Copyright (c) 2013-2019 Simon van Heeringen <simon.vanheeringen@gmail.com>
3-
#
4-
# This module is free software. You can redistribute it and/or modify it under
5-
# the terms of the MIT License, see the file COPYING included with this
6-
# distribution.
72
import argparse
83
import os
94
import sys
5+
import warnings
106
from io import StringIO
117

128
from gimmemotifs.__about__ import __version__
139

10+
warnings.filterwarnings("ignore")
11+
1412

1513
def gimme():
1614
description = f"GimmeMotifs v{__version__}"
@@ -186,6 +184,13 @@ def gimme():
186184
default=params["size"],
187185
type=int,
188186
)
187+
p.add_argument(
188+
"--noprogress",
189+
dest="noprogress",
190+
help="Disable tqdm progress bars",
191+
default=False,
192+
action="store_true",
193+
)
189194

190195
p.set_defaults(func=commands.motifs)
191196

@@ -410,6 +415,13 @@ def gimme():
410415
action="store_true",
411416
default=False,
412417
)
418+
p.add_argument(
419+
"--noprogress",
420+
dest="noprogress",
421+
help="Disable tqdm progress bars",
422+
default=False,
423+
action="store_true",
424+
)
413425

414426
p.set_defaults(func=commands.maelstrom)
415427

gimmemotifs/commands/background.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Copyright (c) 2009-2019 Simon van Heeringen <simon.vanheeringen@gmail.com>
2-
#
3-
# This module is free software. You can redistribute it and/or modify it under
4-
# the terms of the MIT License, see the file COPYING included with this
5-
# distribution.
61
from gimmemotifs.background import create_background_file
72

83

gimmemotifs/commands/cluster.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env python
2-
# Copyright (c) 2009-2019 Simon van Heeringen <s.vanheeringen@science.ru.nl>
3-
#
4-
# This module is free software. You can redistribute it and/or modify it under
5-
# the terms of the MIT License, see the file COPYING included with this
6-
# distribution.
72
import logging
83
import os
94

0 commit comments

Comments
 (0)