Skip to content

Commit

Permalink
Merge pull request #4 from portugueslab/npe2
Browse files Browse the repository at this point in the history
from napari-plugin-engine to npe2
  • Loading branch information
ywkure authored May 3, 2023
2 parents 49ea3fc + c418c1b commit 56ebda1
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 86 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -24,9 +24,9 @@ jobs:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -46,9 +46,9 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@



# hdf5/split-dataset file reader for napari
# split-dataset/hdf5 file reader for napari

A `napari` plugin for visualising [`SplitDataset`](https://github.com/portugueslab/split_dataset) objects. This package has been developed in the [Portugues lab](http://www.portugueslab.com).

2 changes: 1 addition & 1 deletion napari_split_dataset/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""hdf5/split-dataset file reader for napari"""

__author__ = """You Wu @portugueslab"""
__version__ = "0.1.1"
__version__ = "0.2.0"

from napari_split_dataset.napari_split_dataset import napari_get_reader
10 changes: 10 additions & 0 deletions napari_split_dataset/napari.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: napari-split-dataset
contributions:
commands:
- id: napari-split-dataset.get_reader
python_name: napari_split_dataset.napari_split_dataset:napari_get_reader
title: Open SplitDataset files
readers:
- command: napari-split-dataset.get_reader
accepts_directories: true
filename_patterns: ["*.h5", "*.hdf5"]
7 changes: 3 additions & 4 deletions napari_split_dataset/napari_split_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

import flammkuchen as fl
import numpy as np
from napari_plugin_engine import napari_hook_implementation
from split_dataset import SplitDataset


@napari_hook_implementation
def napari_get_reader(path):
path = Path(path)
if path.is_dir():
Expand Down Expand Up @@ -40,7 +38,7 @@ def read_directory(path):
data = data[:, :, :]
add_kwargs = {}

layer_type = "image" # default
layer_type = "image"
return [(data, add_kwargs, layer_type)]


Expand All @@ -61,4 +59,5 @@ def read_hdf5(path):
return None

add_kwargs = {}
return [(data, add_kwargs)]
layer_type = "image"
return [(data, add_kwargs, layer_type)]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements_dev.txt

This file was deleted.

57 changes: 53 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,60 @@
[metadata]
name = napari-split-dataset
version = 0.2.0
url = https://github.com/portugueslab/napari-split-dataset
author = You Wu @portugueslab
author_email = [email protected]
classifiers =
Development Status :: 2 - Pre-Alpha
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
license = MIT
description = split-dataset/hdf5 file reader for napari
long_description = file: README.md
long_description_content_type = text/markdown

[options]
zip_safe = False
# setup_requires = pytest-runner
install_requires =
numpy
flammkuchen
split_dataset
python_requires = >=3.7
tests_require = pytest>=3
test_suite = tests
include_package_data = True
packages = find_namespace:

[options.extras_require]
dev =
pytest
pytest-cov
black
flake8
isort

[options.entry_points]
napari.manifest =
napari-split-dataset = napari_split_dataset:napari.yaml

[options.package_data]
napari_split_dataset = napari.yaml

[bumpversion]
current_version = 0.1.1
current_version = 0.2.0
commit = True
tag = True

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
[bumpversion:file:setup.cfg]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:napari_split_dataset/__init__.py]
search = __version__ = "{current_version}"
Expand Down
57 changes: 2 additions & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,58 +1,5 @@
#!/usr/bin/env python

"""The setup script."""
from setuptools import setup

from setuptools import find_namespace_packages, setup

with open("README.md") as readme_file:
readme = readme_file.read()

with open("requirements.txt") as f:
requirements = f.read().splitlines()

with open("requirements_dev.txt") as f:
requirements_dev = f.read().splitlines()

setup_requirements = [
"pytest-runner",
]

test_requirements = [
"pytest>=3",
]

setup(
author="You Wu @portugueslab",
author_email="[email protected]",
python_requires=">=3.5",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
description="hdf5/split-dataset file reader for napari",
long_description=readme,
long_description_content_type="text/markdown",
extras_require=dict(dev=requirements_dev),
entry_points={
"napari.plugin": ["split-dataset = napari_split_dataset"],
},
install_requires=requirements,
license="MIT",
include_package_data=True,
keywords="napari_split_dataset",
name="napari_split_dataset",
packages=find_namespace_packages(exclude=("docs", "tests*")),
setup_requires=setup_requirements,
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/portugueslab/napari_split_dataset",
version="0.1.1",
zip_safe=False,
)
setup()

0 comments on commit 56ebda1

Please sign in to comment.