Skip to content

Commit

Permalink
fix(cli): Add entry point for CLI
Browse files Browse the repository at this point in the history
It seems we forgot to add an entry point where we originally created the CLI.  This should fix it.

I also realized that the command doesn't give any indication of the simulation progress so I am adding a print statement so that people aren't left hanging for over a minute without any indication of how much longer the simulation will take.

We should ass an option to silence this reporting for those who don't want it.

CC: @saeranv
  • Loading branch information
Chris Mackey committed Jan 18, 2021
1 parent 863c140 commit 00cf769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions uwg/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from uwg.cli import main

if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions uwg/uwg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,10 @@ def simulate(self):
'{} days from {}/{}.'.format(self.nday, self.month, self.day))

# iterate through every simulation time-step (i.e 5 min) defined by UWG
day_step = int((1 / self.ph) * 24)
for it in range(1, self.simTime.nt, 1):
if it % day_step == 0:
print('Simulating Day {}'.format(int(it / day_step)))
# Update water temperature (estimated)
if self.nSoil < 3:
# for BUBBLE/CAPITOUL/Singapore only
Expand Down

1 comment on commit 00cf769

@saeranv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding this @chriswmackey !

Please sign in to comment.