Skip to content

Commit

Permalink
Merge pull request #145 from BBQuercus/qol_create
Browse files Browse the repository at this point in the history
Prepare for release 0.1.4
  • Loading branch information
BBQuercus authored Nov 1, 2022
2 parents b657d58 + 42798ae commit 9152b5b
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.3
current_version = 0.1.4
commit = False
tag = True

Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ jobs:
unittest:
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install tox
run: python -m pip install --upgrade tox virtualenv setuptools pip codecov
- name: run tox
run: tox -e py
- name: upload coverage reports to Codecov
run: codecov
env:
super_secret: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install tox
run: python -m pip install --upgrade tox virtualenv setuptools pip codecov
- name: run tox
run: tox -e py
- name: upload coverage reports to Codecov
run: codecov
env:
super_secret: ${{ secrets.CODECOV_TOKEN }}

# Important checks but not reliant on different versions
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: install tox
run: python -m pip install --upgrade tox virtualenv setuptools pip
- name: run tox deploy
run: tox -e deploy
- name: run tox safety
run: tox -e safety
- name: run tox style
run: tox -e style
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: install tox
run: python -m pip install --upgrade tox virtualenv setuptools pip
- name: run tox deploy
run: tox -e deploy
- name: run tox safety
run: tox -e safety
- name: run tox style
run: tox -e style
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: "deepblink"
version: 0.1.3
version: 0.1.4
source:
path: ..

Expand All @@ -17,7 +17,7 @@ requirements:
- pip
- setuptools
run:
- python>=3.6,<3.9
- python>=3.7,<3.11
- matplotlib>=3.0.0
- requests>=2.0.0
- numpy>=1.17.0
Expand Down
2 changes: 1 addition & 1 deletion deepblink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- util: Basic utility functions not fitting into a category.
"""

__version__ = "0.1.3"
__version__ = "0.1.4"

from . import augment
from . import cli
Expand Down
2 changes: 1 addition & 1 deletion deepblink/cli/_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _parse_args_create(
"If given, will convert all labels to pixel coordinates. "
"Can be a single value or a tuple of two values for x and y, respectively. "
"If only one value is given, it will be used for both x and y. "
"[default: 1]"
"[default: None]"
),
)
group2.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion deepblink/cli/_parseutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _add_utils(parser: argparse.ArgumentParser):
"-V",
"--version",
action="version",
version="%(prog)s 0.1.3",
version="%(prog)s 0.1.4",
help="Show %(prog)s's version number.",
)
group.add_argument(
Expand Down
11 changes: 10 additions & 1 deletion deepblink/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import random

from PIL import Image
from PIL import UnidentifiedImageError
from PIL.TiffTags import TAGS
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -139,8 +140,16 @@ def predict_pixel_size(fname: Union[str, "os.PathLike[str]"]) -> Tuple[float, fl
raise ValueError(f"{fname} is not a tif file.")
if not os.path.isfile(fname):
raise ValueError(f"{fname} does not exist.")
if not os.path.getsize(fname):
raise ValueError(f"{fname} does not contain any data.")

image = Image.open(fname)
try:
image = Image.open(fname)
except UnidentifiedImageError as err:
raise ValueError(
f"{fname} could not be read by PIL. "
f"Check the format or pass a pixel-size directly."
) from err
if len(image.size) != 2:
raise ValueError(f"Image {fname} has more than 2 dimensions.")

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
year = "2020"
author = "Bastian Eichenberger"
copyright = f"{year}, {author}"
version = release = "0.1.3"
version = release = "0.1.4"

pygments_style = "trac"
templates_path = ["."]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
setup(
# Description
name="deepblink",
version="0.1.3",
version="0.1.4",
license="MIT",
description="Threshold independent detection and localization of diffraction-limited spots.",
long_description_content_type="text/plain",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{36,37,38},
py{37,38,39,310,311},
deploy,
safety,
style
Expand Down

0 comments on commit 9152b5b

Please sign in to comment.