Skip to content

Commit

Permalink
remove helper methods from get_data, move logic to the individual moduls
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayd committed Aug 9, 2022
1 parent 4b98217 commit 2d89642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/pygenesis/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd


def get_data(data: str) -> pd.DataFrame:
def get_cubefile_data(data: str) -> pd.DataFrame:
"""Return cubefile data as pandas data frame.
Args:
Expand Down
15 changes: 3 additions & 12 deletions src/pygenesis/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd

from pygenesis.cache import cache_data
from pygenesis.cube import parse_cube, rename_axes
from pygenesis.cube import get_cubefile_data
from pygenesis.http_helper import get_response_from_endpoint
from pygenesis.table import get_tablefile_data

Expand Down Expand Up @@ -44,15 +44,6 @@ def get_data(
data = response.text

if method == "tablefile":
return _get_tablefile_data(data)
return get_tablefile_data(data)
else:
return _get_cubefile_data(data)


def _get_cubefile_data(data: str) -> pd.DataFrame:
cube = rename_axes(parse_cube(data))
return cube["QEI"]


def _get_tablefile_data(data: str) -> pd.DataFrame:
return get_tablefile_data(data)
return get_cubefile_data(data)

0 comments on commit 2d89642

Please sign in to comment.