-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adding region and institution hierarchy to graphs/subgraphs #197
Conversation
Build Status ReportBuild |
Thanks @stompsjo for this contributions. Can you please add an entry to the |
The errors occuring are: Initially I thought it might be related to the recent switch to mambaforge, however the error is occurring on the stable version as well (which still uses miniconda). This stackoverflow post suggests we may need to pin the EDIT: Pandas 2.2.2 should be compatible with numpy 2.0. Looking into this more |
To the best of my knowledge this is the dependency situation:
An issue was made last week in the PyTables repo regarding this. Until that issue is resolved... if we want CI to pass I think the easiest fix is to pin |
That's fine as long as we have a way to remember to check on this as the compatibility progresses |
Sounds good. I will make a PR with the temporary fix, as well as an open issue to check on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little question...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gonuke I pushed a couple other updates inspired by your suggestion.
institutions = agents_[ | ||
(agents_["ParentId"] == region_id) & (agents_["Kind"] == "Inst") | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line with using Kind
to filter for Region
, we can also use Inst
to ensure that we are filtering the appropriate agents.
facilities = agents_[ | ||
(agents_["ParentId"] == institution_id) | ||
& (agents_["Kind"] == "Facility") | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise for facilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks @stompsjo
Hello all! I noticed that the default
cymetric.flow_graph
was not giving me quite the flexibility I wanted and thought I would offer this PR in case anyone else was interested. Here's a summary of what these changes do:ID
s produced byevaler.eval("AgentEntry")
rather than withevaler.eval("AgentEntry")["Prototype"].tolist()
. Maybe we could include another input toflow_graph
that disables this functionality.dot.subgraph(name="cluster_")
syntax, but I think it results in a more organized graph (see example below). Again, all unique regions and institutes in your simulation will be plotted here. I took the liberty of setting some default visualization styles (dotted squares for regions, gray-filled squares for institutions) but I could imagine us supporting flexibility for this feature in the future.strict=True
in the graph ensures that only unique edges are plotted, i.e. if multiple transactions take place between the same two nodes, only one of those edges is plotted. I don't recall if this was a concern before, but I think it might keep things safe from producing vast spaghetti plots.The default engine/solver of graphviz does a good job of organizing the rendered plot, but I have noticed more edge overlap when using this subgraph structure. I have attached an example plot using the tutorial exercise from fuelcycle.org. You can recreate this image by running
cyclus example.xml
and then the following code: