Skip to content

Commit

Permalink
Release related updates (#31)
Browse files Browse the repository at this point in the history
* initial commit

* to keep changes

* to keep changes

* to keep changes

* to keep changes

* to keep changes

* to keep changes

* to keep changes

* to keep changes

* to keep changes
  • Loading branch information
AhmetCanSolak authored Nov 6, 2021
1 parent 9c89050 commit 4b69f9e
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ docs/build
# Distribution / packaging
.Python
develop-eggs/
build/
dist/
downloads/
eggs/
Expand Down Expand Up @@ -121,3 +122,4 @@ build/win/build
.zgroup
*.png

aydin/_version.py
5 changes: 5 additions & 0 deletions aydin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
from aydin.restoration.denoise.classic import Classic # noqa: F401
from aydin.restoration.denoise.classic import classic_denoise # noqa: F401
from aydin.restoration.deconvolve.lr import lucyrichardson # noqa: F401

try:
from ._version import version as __version__
except ImportError:
__version__ = "not-installed"
24 changes: 9 additions & 15 deletions aydin/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import click
import numpy
import napari
from importlib_metadata import version, PackageNotFoundError

from aydin.gui.gui import run
from aydin.it.base import ImageTranslatorBase
Expand All @@ -16,22 +15,17 @@
from aydin.util.misc.json import load_any_json
from aydin.util.log.log import lprint, Log
from aydin.util.misc.slicing_helper import apply_slicing

from aydin import __version__

CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])

VERSION = None

try:
VERSION = version("aydin")
except PackageNotFoundError:
lprint("Aydin installation has problems, please re-install")
VERSION = __version__


@click.group(invoke_without_command=True, context_settings=CONTEXT_SETTINGS)
@click.pass_context
@click.version_option(version=VERSION)
def aydin(ctx):
def cli(ctx):
"""aydin cli
Parameters
Expand All @@ -56,7 +50,7 @@ def exception_hook(exctype, value, traceback):
pass


@aydin.command()
@cli.command()
@click.argument('files', nargs=-1)
@click.option('-ts', '--training-slicing', default='', type=str)
@click.option('-is', '--inference-slicing', default='', type=str)
Expand Down Expand Up @@ -150,7 +144,7 @@ def denoise(files, **kwargs):
lprint("DONE")


@aydin.command()
@cli.command()
@click.argument('files', nargs=-1)
@click.argument('psf_path', nargs=1)
@click.option('-s', '--slicing', default='', type=str)
Expand Down Expand Up @@ -184,7 +178,7 @@ def lucyrichardson(files, psf_path, **kwargs):
imwrite(deconvolved, path)


@aydin.command()
@cli.command()
@click.argument('files', nargs=-1)
@click.option('-s', '--slicing', default='', type=str)
def info(files, **kwargs):
Expand All @@ -201,7 +195,7 @@ def info(files, **kwargs):
) # we are not printing anything here as aydin.io.imread prints logs


@aydin.command()
@cli.command()
@click.argument('files', nargs=-1)
@click.option('-s', '--slicing', default='', type=str)
def view(files, **kwargs):
Expand All @@ -225,7 +219,7 @@ def view(files, **kwargs):
viewer.add_image(image, name=filenames[idx])


@aydin.command()
@cli.command()
@click.argument('files', nargs=-1)
@click.option('-s', '--slicing', default='', type=str)
def hyperstack(files, **kwargs):
Expand Down Expand Up @@ -282,4 +276,4 @@ def handle_files(files, slicing):


if __name__ == '__main__':
aydin()
cli()
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
target-version = ['py36', 'py37']
skip-string-normalization = true


[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
requires = [
"setuptools >= 42",
"wheel",
"setuptools_scm[toml]>=3.4"
]

[tool.setuptools_scm]
write_to = "aydin/_version.py"
3 changes: 1 addition & 2 deletions requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ qtpy==1.11.2
scikit-image==0.18.3
tensorflow==2.6.0
keras==2.6.0
zarr==2.4.0; sys_platform == "darwin"
zarr==2.10.2; sys_platform == "win32" or sys_platform == "linux"
zarr==2.4.0
51 changes: 50 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
[metadata]
description-file = README.md
name = aydin
url = https://royerlab.github.io/aydin/
download_url = https://github.com/royerlab/aydin
license = BSD 3-Clause
license_file = LICENSE.txt
description = Aydin - Denoising but chill
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 3 - Alpha
Environment :: X11 Applications :: Qt
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Image Processing
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS

[options]
zip_safe = False
packages = find:
python_requires = >=3.9
include_package_data = True
install_requires =
catboost==1.0.1
Click==8.0.3
czifile==2019.7.2
docstring-parser==0.12
gdown==4.2.0
googledrivedownloader==0.4
importlib-metadata==4.8.1
jsonpickle==1.3.0
lightgbm==3.3.1
napari==0.4.12
nd2reader==3.3.0
numba==0.54.1
numexpr==2.7.3
numpy>=1.19.2
pynndescent==0.5.5
PyQt5==5.15.5
QDarkStyle==3.0.2
qtpy==1.11.2
scikit-image==0.18.3
tensorflow==2.6.0
keras==2.6.0
zarr==2.4.0
41 changes: 15 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
import sys
import os
from setuptools import setup


if sys.version_info < (3, 7):
if sys.version_info < (3, 9):
sys.stderr.write(
f'You are using Python '
+ "{'.'.join(str(v) for v in sys.version_info[:3])}.\n\n"
+ 'aydin only supports Python 3.7 and above.\n\n'
+ 'Please install Python 3.7 using:\n'
+ ' $ pip install python==3.7\n\n'
+ 'aydin only supports Python 3.9 and above.\n\n'
+ 'Please install Python 3.9 using:\n'
+ ' $ pip install python==3.9\n\n'
)
sys.exit(1)

with open(os.path.join('requirements', 'default.txt')) as f:
default_requirements = [
line.strip() for line in f if line and not line.startswith('#')
]

INSTALL_REQUIRES = default_requirements
REQUIRES = []
# with open(os.path.join('requirements', 'default.txt')) as f:
# default_requirements = [
# line.strip() for line in f if line and not line.startswith('#')
# ]
#
# INSTALL_REQUIRES = default_requirements
# REQUIRES = []

# Handle pyopencl
# os.system("pip install -r " + os.path.join('requirements', 'pyopencl.txt'))

setup(
name='aydin',
packages=['aydin'],
use_scm_version=True,
use_scm_version={"write_to": "aydin/_version.py"},
setup_requires=['setuptools_scm'],
install_requires=INSTALL_REQUIRES,
py_modules=['aydin'],
entry_points='''
[console_scripts]
aydin=aydin.cli.cli:aydin
''',
download_url='https://github.com/royerlab/aydin/archive/refs/tags/v0.1.6.tar.gz',
classifiers=[
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3.9',
],
entry_points={
'console_scripts': ['aydin=aydin.cli.cli:cli']
},
)

0 comments on commit 4b69f9e

Please sign in to comment.