Skip to content

Finishing Ops Model components #107

@rburghol

Description

@rburghol

@COBrogan

LATEST WORK STOP STEPS: respec#197 (comment)

  • (9/10-14/2025) Review pandas df only UCI, and Develop base class for native HSPF features, and ops model, and prototype looping. Present to steering committee.
  • (10/13/2025) Refactor state to enhance readability and usability
  • (10/20-25/2025) Add single PR with all current prototype components (See the PR roadmap issue Development Plan: Merges into develop-specact (1-2/2024) #80 )
    • Locate draft @njit and parser/handler functions for each existing set of objects
    • Add a branch to house this set of PRs https://github.com/HARPgroup/HSPsquared/tree/develop-om
    • Consider combining into a folder for easier readability
    • Do we need develop-else (or has Tim's changes fixed this)? Develop else respec/HSPsquared#190
    • Consider renaming classes to append "Handler": these have all been done as means of translating json/nested dataframes into objects
    • Start by adding a stub for each object component type we plan to have. Talked to Paul about getting them in via PR, with the understanding that no code gets implemented until a companion testing data set is there.
    • Add single library file for all op model objects
      • Talk to Paul: should we do separate lib file for handlers and executable @njit code?
  • (10/27-11/3/2025) Develop Facility model test
    • json includes: test matrix, flowby, equation and broadcast
  • (11/10-14/2025) Develop very basic classes for model overall execution (RCHRES, PERLND, IMPLND, COPY, GENER)
  • Revisit test of associative array performance, Dynamic Object Calculation (form and speed) #35
    • Create script directory and prototype testing scripts. See https://github.com/HARPgroup/HSPsquared/blob/develop-hydrclass/src/hsp2/hsp2/classes/model.test.class.py
    • Repeat performance tests for three most recent versions of Python Dynamic Object Calculation (form and speed) #35
    • Overarching questions:
      • (YES) Are class properties faster than class named Dict references? (i.e. is self$volint = self$volt - (self$ks * self$roseff * self$delts) faster than self['state']['volint'] = self['state']['volt'] - (self['state']['ks'] * self['state']['roseff'] * self['state']['delts'])?
      • Can we store state as pandas slices, like if state['RCHRESR001'] contained ['OVOL'], ['IVOL'], ... and then we could at create set self.state = state['/RCHRESR001'] and then maths that we did in the loop would be like `self.state['IVOL'] = X' and that would auto write to
      • Create a testing class with 8 permutations (2 * ts reading/writing, 2* state reading/writing, 2 * execution)
      • is there a difference in speed for executing class methods versus passing class data to an external function?
    • NJIT main loop versus Python main loop revisited
    • consider performance impact of storing main objects such as RCHRES and PERLND in lists keyed according to a string,
    • Create a generic benchmarking script to include in tests
    • Check out codon and potential performance improvements (check njit and non-njit) https://www.usenix.org/publications/loginonline/codon-python-compiler-update
    • Enable generic object support for op models with op_components object holding ops
      • Either with step function that calls hard-wired component step functions based on comp settings
      • Or a separate list of processor objects for each type, and use numeric key to ID which type list to load from at execution time?
      • Could one of these objects contain a reference to the time series array for the given component, like each physical gets an object for it's properties, ie RCHRESR001 can live in an object with references to all its properties?
    • for testing, we can just create a associative array version of the existing step functions in very short order
  • IF-THEN special action with dynamic exec list modification
    • Plan & Implement IF-THEN turn on /off
      • Meet with Tim Cera to plan architecture
      • Add prototype handling of enable/disable spec-actions based on remote property value 0/1
    • This will be used for flow dependent AGWRC initial implementation
    • This will also allow subsequently testing of dataMatrix version of the AGWRC variation
  • HSP2 main loop considerations Main Loop to support timestep level integration of processes and respec/HSPsquared#186
    • single step HYDR function is priority, just to ensure that our OPS model and single step versions will work seamlessly.
    • timing stuff takes up much space in HSPF code but can be streamlined into a single function? Or maybe a timing function and a ts loader?
    • single step PERLND, IMPLND, and SEDTRN/ADCALC etc functions are lower priority, maybe add stubs
  • Testing framework support
    • each function must have test coverage to merge
  • Meet with Karin Klein to brief her on our project and get her perspective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions