Skip to content

Commit

Permalink
feat: Add VisitMetrics and VisitPaths traits and implementation.
Browse files Browse the repository at this point in the history
This adds methods to the network and various components for
"visiting" Metrics and Paths. These methods are useful for finding,
for example, all paths in a model.

The traits are trivially implemented for common types. New derive
macros replace the previous PywrNode macro. These macros generate
implementations of the two traits for the struct and enum types
currently used in the schema.

Outstanding items:
- [ ] Should there be separate `visit_` and `walk_` methods. Where
walk would be recursive, but visit not?
  • Loading branch information
jetuk committed Apr 26, 2024
1 parent 90e42b3 commit de63c99
Show file tree
Hide file tree
Showing 43 changed files with 1,299 additions and 580 deletions.
4 changes: 2 additions & 2 deletions pywr-schema-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ proc-macro = true
[dependencies]
syn = "2.0.52"
quote = "1.0.35"


heck = "0.5.0"
proc-macro2 = "1.0.81"
Loading

0 comments on commit de63c99

Please sign in to comment.