Skip to content

Code improvements #99

Description

@veenstrajelmer

Documentation:

  • update docstrings in all exposed functions in modules section
  • fix python code coloring in embedded ipynb
  • docs: maybe move to myst-nb (extension myst_nb) instead of nbsphinx, this also removes the pandoc dependency but does generate quite some warnings during doc building

hatyansettings:

  • move validation of timestep argument for prediction() to HatyanSettings?
  • clean up HatyanSettings related code, maybe validate arguments in a more charming way
  • also validate const_list and times with hatyan.HatyanSettings, const_list is now validated with check_requestedconsts multiple times (u/f/analysis functions), times is validated in hatyan.prediction()
  • maybe make kwargs in HatyanSettings to reduce number of input arguments. Still raise exception if not all kwargs were popped after init. complexity of this class is also way too high, so maybe first redesign it.

resample_timeseries:

  • hatyan.resample_timeseries(): round dataframe to 'S' before doing anything, start new datetimeindex on 00 minute
  • make resample_timeseries() work with times slice instead of three keywords? Or deprecate. At least covert timestep_min to timestep and do freq validation there

metadata:

  • Consider updating metadata "origin" attribute of components object: when slotgem is overwritten, with component splitting, with merging of component sets, in case of analysis-perperiod vs. atonce and maybe other settings. Not possible to derive these details from existing/old components file, so is it useful?
  • add vertref/station from metadata to components/timeseries plot (if available), also requires comparing these attrs between input arguments

Code improvements:

  • Improve code quality #57
  • Increase performance with numba (Lru_cache also helps significantly), maybe add pandas performance dependencies
  • Align foreman/schureman, avoids code with same functions. Not easy, but aligning shallowrelations should be possible. Or move from schureman to simplified foreman?
  • Improve analysis prediction varnames? (eg v, u, f)
  • Check if there are any try/except combi's that are not error specific. Raise predefined errors like ValueError or custom errors like like hatyan.analyis_prediction.MatrixConditionTooHigh and catch them properly (not a general 'except:' and no general 'raise Exception()')
  • Numbering of extremes/HWLW: store phasediff-compute-script (numbering_extremes.py) properly

Improve configfiles:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions