Skip to content

Commit

Permalink
Add ramp_convert .py to .xlsx files to command line
Browse files Browse the repository at this point in the history
  • Loading branch information
Bachibouzouk committed May 7, 2024
1 parent 0e05c81 commit 673d5d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ramp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ramp.core.utils import yearly_pattern, get_day_type
from ramp.example.examples import load_data, download_example
from ramp.post_process.post_process import Plot
from ramp.ramp_convert_old_input_files import convert_old_user_input_file as ramp_py2xlsx

__authors__ = "Listed in AUTHORS"
__copyright__ = (
Expand Down
7 changes: 5 additions & 2 deletions ramp/ramp_convert_old_input_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

parser = argparse.ArgumentParser(
prog="python ramp_convert_old_input_files.py",
description="Convert old python input files to xlsx ones",
description="Convert RAMP python input files to xlsx ones",
)
parser.add_argument(
"-i",
Expand Down Expand Up @@ -88,7 +88,7 @@ def convert_old_user_input_file(
UseCase(users=user_list).save(output_fname)


if __name__ == "__main__":
def cli():
args = vars(parser.parse_args())
fname = args["fname_path"]
output_path = args.get("output_path")
Expand All @@ -105,3 +105,6 @@ def convert_old_user_input_file(
)
else:
convert_old_user_input_file(fname, output_path=output_path, suffix=suffix)

if __name__ == "__main__":
cli()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
entry_points={
"console_scripts": [
"ramp=ramp.cli:main",
"ramp_convert=ramp.ramp_convert_old_input_files:cli",
],
},
)

0 comments on commit 673d5d1

Please sign in to comment.