schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
23 stars 18 forks source link

Question: Should I set up tidal boundary per open boundary? #108

Open SorooshMani-NOAA opened 8 months ago

SorooshMani-NOAA commented 8 months ago

In the old pyschism API, I would just specify the type of tidal BC I needed, e.g. elevation and velocity, and it would automatically write it for all the open boundary conditions in the mesh files. It seems now that the new API requires that I know the number of open boundary conditions, and pass the conditions for each boundary separately.

This is really inconvenient when dealing with automation scripts. Do you have a suggested/preferred way of setting the boundary types for all the mesh open boundaries? Should I just say something like:

...
flags=[[0,0,3,3] for i in hgrid.boundaries.open.itertuples()]
...

or there's a better way?

cuill commented 8 months ago

@SorooshMani-NOAA Sorry for the inconvenience. These changes were made to expose more options to users as Joseph requested and to make it more robust. For example, the Pacific mesh has 9 open boundaries, including several rivers. You still need to specify bctypes for each boundary with the old API. In your case, the way you suggested can work. I'll think about if we can do it better.

SorooshMani-NOAA commented 8 months ago

I see thank you. So for now I stick with the for-loop in my prior comment. That's good enough, but I just wanted to make sure there's no better way. Take my feedback mainly as a "legacy user" feedback; I'm used to doing something and I bring it up when I see a change!

cuill commented 8 months ago

@SorooshMani-NOAA No problem. And thanks for making an effort to test the changes, which is good to make pyschism more bug-free and user-friendly.