Skip to content

Commit

Permalink
Merge changes that were reverted from respec#159
Browse files Browse the repository at this point in the history
  • Loading branch information
Burgholzer authored and Burgholzer committed May 7, 2024
1 parent c571c9d commit 3006ec7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions HSP2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from pandas import DataFrame, date_range
from pandas.tseries.offsets import Minute
from datetime import datetime as dt
from typing import Union
import os
from HSP2IO.hdf import HDF5
from HSP2.utilities import versions, get_timeseries, expand_timeseries_names, save_timeseries, get_gener_timeseries
from HSP2.configuration import activities, noop, expand_masslinks
from HSP2.state import *
Expand All @@ -17,13 +19,14 @@

from HSP2IO.io import IOManager, SupportsReadTS, Category

def main(io_manager:IOManager, saveall:bool=False, jupyterlab:bool=True) -> None:
"""Runs main HSP2 program.
def main(io_manager:Union[str, IOManager], saveall:bool=False, jupyterlab:bool=True) -> None:
"""
Run main HSP2 program.
Parameters
----------
saveall: Boolean - [optional] Default is False.
io_manager
An instance of IOManager class.
saveall: bool, default=False
Saves all calculated data ignoring SAVE tables.
jupyterlab: Boolean - [optional] Default is True.
Flag for specific output behavior for jupyter lab.
Expand All @@ -32,7 +35,9 @@ def main(io_manager:IOManager, saveall:bool=False, jupyterlab:bool=True) -> None
None
"""

if isinstance(io_manager, str):
hdf5_instance = HDF5(io_manager)
io_manager = IOManager(hdf5_instance)
hdfname = io_manager._input.file_path
if not os.path.exists(hdfname):
raise FileNotFoundError(f'{hdfname} HDF5 File Not Found')
Expand Down

0 comments on commit 3006ec7

Please sign in to comment.