CADWRDeltaModeling / BayDeltaSCHISM

Tools, scripts, templates and data for running SCHISM on the Bay-Delta
https://cadwrdeltamodeling.github.io/BayDeltaSCHISM
Apache License 2.0
5 stars 7 forks source link

uv3d utility #36

Open water-e opened 1 year ago

water-e commented 1 year ago

Design is in BayDeltaSCHISM/bdschism_design.py.txt, including an interface that includes the required options. Need: implementation, in stages:

  1. First stage should work on basic case where interpolate_variables executable is on path and no special links, but would include use of param.nml for inference. Other stuff should raise NotImplementedError. First stage includes create_arg_parser and should be formatted using the 'black' formatter which you can install in python or through VS Code.
  2. Second stage should be a complete installation
  3. The utility 'uv3d' (all lower case) should be listed in setup.py of bdschism so that the python file automatically turns into a native utility
  4. Document in topical guide, with references in vignette. This can mostly be done automatically with sphinx_argparse.
  5. Take care of cloud issues, especially batch, when it isn't clear that interpolate variables is on path. Perhaps this script would have to be wrapped? Check in with Nicky and Shey on this.
HansKimDWR commented 1 year ago

@water-e I have two questions:

  1. What do we do if interpolate_variables.in is not given? Should we create interpolate_variables.in based on the contents of param.nml?
  2. Could we assume Linux environment? That is, could we use "ln -sf" whenever symbolic links are created?
water-e commented 1 year ago
  1. Take a look at the uv3d.py design in the design document. The usual one is a very small text string, easily stored in the script but templated on number of days. I think it is in there.
  2. You should use python os.path tools to create or follow links. You shouldn't have to use commands.

From: HansKimDWR @.> Sent: Friday, July 21, 2023 4:01 PM To: CADWRDeltaModeling/BayDeltaSCHISM @.> Cc: Ateljevich, @. @.>; Mention @.***> Subject: Re: [CADWRDeltaModeling/BayDeltaSCHISM] uv3d utility (Issue #36)

@water-ehttps://github.com/water-e I have two questions:

  1. What do we do if interpolate_variables.in is not given? Should we create interpolate_variables.in based on the contents of param.nml?
  2. Could we assume Linux environment? That is, could we use "ln -sf" whenever symbolic links are created?

— Reply to this email directly, view it on GitHubhttps://github.com/CADWRDeltaModeling/BayDeltaSCHISM/issues/36#issuecomment-1646322671, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG2AJCY3OZ6NHGZIYID7ZPLXRMC5LANCNFSM6AAAAAA2SIVWAI. You are receiving this because you were mentioned.Message ID: @.***>

HansKimDWR commented 1 year ago

@water-e I have re-read the design document, but something is still not clear to me: interpolate_variables8 is a binary that is hard-wired to read interpolate_variables.in. Without this input file, how do we give parameter values to the binary? Could you give more guidance please?

HansKimDWR commented 1 year ago

@water-e @dwr-psandhu My latest commit to uv3D (https://github.com/CADWRDeltaModeling/BayDeltaSCHISM/blob/master/bdschism/bdschism/uv3d.py) contains all necessary implementations except for running interpolate_variables8 executable. The issue is that the series of subprocess.run() commands at the end of the main function does not run correctly. It seems interpolate_variables8 is run even before the command "ulimit -s unlimited" is registered, and segmentation fault error is encountered. Is there a better way of running series of shell commands?

water-e commented 1 year ago

The real question is how much of this type of thing to load into a script called uv3d.py. Maybe there have to be requirements on the environment? ulimit is pretty standard.


From: HansKimDWR @.> Sent: Tuesday, July 25, 2023 4:35 PM To: CADWRDeltaModeling/BayDeltaSCHISM @.> Cc: Ateljevich, @. @.>; Mention @.***> Subject: Re: [CADWRDeltaModeling/BayDeltaSCHISM] uv3d utility (Issue #36)

@water-ehttps://github.com/water-e @dwr-psandhuhttps://github.com/dwr-psandhu My latest commit to uv3D (https://github.com/CADWRDeltaModeling/BayDeltaSCHISM/blob/master/bdschism/bdschism/uv3d.py) contains all necessary implementations except for running interpolate_variables8 executable. The issue is that the series of subprocess.run() commands at the end of the main function does not run correctly. It seems interpolate_variables8 is run even before the command "ulimit -s unlimited" is registered, and segmentation fault error is encountered. Is there a better way of running series of shell commands?

— Reply to this email directly, view it on GitHubhttps://github.com/CADWRDeltaModeling/BayDeltaSCHISM/issues/36#issuecomment-1650705913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG2AJC62KYEW7U6QQGPLWF3XSBJ3VANCNFSM6AAAAAA2SIVWAI. You are receiving this because you were mentioned.Message ID: @.***>