Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jython docs for all tools (timeshifter, transposer, etc) #65

Open
openSourcerer9000 opened this issue May 2, 2022 · 2 comments
Open

Comments

@openSourcerer9000
Copy link

Good afternoon,

There is complete documentation on the Jython API for the Importer tool, and it appears some docs on sanitizer etc, but I would like to request a complete Jython API documentation for the rest of these tools.

It seems the whole functionality is exposed through Jython, and I'm able to dir() my way through one object at a time, but it's a tedious process without a roadmap.

@openSourcerer9000
Copy link
Author

openSourcerer9000 commented May 3, 2022

This is the general pattern for time-shifter. Doc strings for each method will be helpful as well,

from mil.army.usace.hec.vortex.math import Shifter
from mil.army.usace.hec.vortex.io import DataReader

from java.time import Duration

inDSS = r'C:\in.dss'
outDSS = r'C:\out.dss'

shiftby = Duration.ofMinutes(30)
# All units options:
# https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#:~:text=the%20specified%20unit.-,static%20Duration,Obtains%20a%20Duration%20representing%20a%20number%20of%20seconds.,-static%20Duration

# find all pathnames:
sourceGrids = DataReader.getVariables(inDSS)

write_opts = {
    'partA': 'A_part',
    'partC': 'PRECIPITATION',
    'dataType': 'PER-CUM',
    'units': 'MM'
}

shifty = Shifter.Builder()\
    .pathToFile(inDSS)\
    .grids(sourceGrids)\
    .destination(outDSS)\
    .shift(shiftby)\
    .writeOptions(write_opts)\
    .build()

shifty.shift()

@Gauravfouzdar
Copy link

where we can find the new vers python script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants