Skip to content

Consider adding universal getter methods for process types #71

@bgroenks96

Description

@bgroenks96

We could define a universal getter like:

get_process(coupled_processes, AbstractEvapotranspiration)

to avoid the boilerplate of every AbstractCoupledProcesses subtype needing to define a series of get_* methods, similar to what was previously done for models.

This could take advantage of the fact that the processes method provides compile-time information about process types defined on any model or coupled processes type.

Alternatively, we could generate such methods for all AbstractCoupledProcesses types semi-automatically using macros.

However, this is also one of those situations where we would trade transparency for a relatively minor reduction in boilerplate. Sometimes boilerplate is good for clarity and simplicity :)

Also LLMs are good at generating boilerplate code, so one could also ask: why bother?

@maximilian-gelbrecht Following up on discussion in #68

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringWho needs new features when you can just make the code nicer!structureIssues related to model code structure or programming patternsuser-interfaceIssue or feature related to the user interface

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions