Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rfma23 committed Aug 7, 2020
1 parent 6136c4b commit 7d7e272
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
5 changes: 4 additions & 1 deletion cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import cli
from . import shell
from . import click_gui


25 changes: 14 additions & 11 deletions cli/cli.py → cli/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# =============================================================================

from click_shell import shell
from cli.click_gui import gui_it, gui_option
import numpy as np
import logging
import click
Expand All @@ -22,22 +23,24 @@
# =============================================================================
# SHELL
# =============================================================================
#@gui_option
#@gui_it
#click.group()
@shell(prompt='[AER-TB] $ ', intro=click.style("""
█████╗ ███████╗██████╗ ████████╗██████╗
█████╗ ███████╗██████╗ ████████╗██████╗
██╔══██╗██╔════╝██╔══██╗ ╚══██╔══╝██╔══██╗
███████║█████╗ ██████╔╝█████╗██║ ██████╔╝
██╔══██║██╔══╝ ██╔══██╗╚════╝██║ ██╔══██╗
██║ ██║███████╗██║ ██║ ██║ ██████╔╝
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝
> An Address Event Representation toolbox for different file extensions.
> Type 'help' to see supported commands.
> Project by Rafael Mosca - https://rfma23.github.io
"""))
def aertb_shell():
def aertb_shell(**argvs):
pass


# =============================================================================
# GLOBALS
# =============================================================================
Expand Down Expand Up @@ -80,17 +83,17 @@ def tohdf5(file, ext, out, polarities):

# ------------------------------------------------------------------------------
@aertb_shell.command()
@click.option("-f", "--file", type=str, default='/',
@click.option("-f", "--file", type=click.Path(exists=True), default='/',
help="Defines the location of the parent directory")
@click.option("-o", "--out", type=str, default='my_dataset.hdf5',
@click.option("-o", "--out", type=click.Path(), default='my_dataset.hdf5',
help="Defines the path and name of the output file")
@click.option("-e", "--ext", type=str, default=None,
help="Defines the file extension to process. Should not include a "
"leading dot")
@click.option("-p", "--polarities", type=str, default='both',
help="Defines the polarities considered {pos, neg, both}")
@click.option("-g", "--gtype", type=str, default='decay',
help="Defines the type of gif visualization considered {decay, std}")
@click.option("-p", "--polarities", type=click.Choice(['both', 'pos', 'neg']), default='both',
help="Defines the polarities considered.")
@click.option("-g", "--gtype", type=click.Choice(['decay', 'std']), default='std',
help="Defines the type of gif visualization considered")
@click.option("-nfr", "--nframes", type=int, default=8,
help="Defines the number of frames produced for the gif")
def makegif(file, out, ext, polarities, gtype, nframes):
Expand Down
Binary file added example_data/hdf5/Bond_TEST.h5
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

setup(
name='aertb',
version="0.3.0",
version="0.3.3",
author="Rafael Mosca",
author_email="rafael.mosca@mail.polimi.it",
url='https://github.com/rfma23',
# scripts=['bin/aertb_cli.py'],
entry_points={
'console_scripts': [
'aertb = cli.cli:aertb_shell',
'aertb = cli.shell:aertb_shell',
],
},
packages=["cli", "aertb", "aertb.core", "aertb.core.loaders"],
Expand Down

0 comments on commit 7d7e272

Please sign in to comment.