Skip to content

Commit

Permalink
many fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leliel12 committed May 9, 2020
1 parent 7256b3a commit e17cb12
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 6 additions & 1 deletion arcovid19/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

DESCRIPTION = __doc__

FOOTNOTES = """This software is under the BSD 3-Clause License.
Copyright (c) 2020, IATE COVID-19 Task Force.
For bug reporting or other instructions please check:
https://github.com/ivco19/libs"""


# =============================================================================
# MAIN_
Expand All @@ -55,7 +60,7 @@ def cases(*, url=CASES_URL, force=False, out=None):
If you want to ignore the local cache or retrieve a new value.
"""
cases = load_cases(url=url, force=force)
cases = load_cases(cases_url=url, force=force)
if out is not None:
cases.to_csv(out)
else:
Expand Down
15 changes: 12 additions & 3 deletions arcovid19/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# IMPORTS
# =============================================================================

import abc
import logging

import attr
Expand All @@ -41,10 +42,14 @@
# =============================================================================

@attr.s(repr=False)
class Plotter:
class Plotter(metaclass=abc.ABCMeta):

cstats = attr.ib()

@abc.abstractproperty
def default_plot_name_method(self):
pass

def __repr__(self):
return f"CasesPlot({hex(id(self.cstats))})"

Expand All @@ -61,12 +66,16 @@ def __call__(self, plot_name=None, ax=None, **kwargs):


@attr.s(repr=False)
class Frame:
class Frame(metaclass=abc.ABCMeta):

df = attr.ib()
extra = attr.ib(factory=dict)
plot = attr.ib(init=False)

@abc.abstractproperty
def plot_cls(self):
pass

@plot.default
def _plot_default(self):
plot_cls = self.plot_cls
Expand All @@ -84,7 +93,7 @@ def __getattr__(self, a):
"""x.__getattr__(y) <==> x.y
Redirect all te missing calls first to extra and then
to the internal datadrame.
to the internal dataframe.
"""
if a in self.extra:
Expand Down

0 comments on commit e17cb12

Please sign in to comment.