cyclus / cymetric

http://fuelcycle.org/user/cymetric/index.html
Other
5 stars 20 forks source link

[Bugfix] graphs.flow_graph: Keeping columns in dataframe used for defining edges #200

Closed stompsjo closed 4 months ago

stompsjo commented 4 months ago

Sorry...I don't know how I missed this before, but there was a mix up with which columns were being saved in the df of graphs.flow_graph and which columns were being used for defining edges. I prefer using SenderId/ReceiverId for defining edges since we can have multiple agents with the same SenderPrototype/ReceiverPrototype, but they will have unique Ids.

P.S. A few pep8 edits while I'm here.

github-actions[bot] commented 4 months ago

Build Status Report

Build FROM cycamore_20.04_apt/cycamore:latest - Success :white_check_mark: Build FROM cycamore_20.04_apt/cycamore:stable - Success :white_check_mark: Build FROM cycamore_20.04_conda/cycamore:latest - Success :white_check_mark: Build FROM cycamore_20.04_conda/cycamore:stable - Success :white_check_mark: Build FROM cycamore_22.04_apt/cycamore:latest - Success :white_check_mark: Build FROM cycamore_22.04_apt/cycamore:stable - Success :white_check_mark: Build FROM cycamore_22.04_conda/cycamore:latest - Success :white_check_mark: Build FROM cycamore_22.04_conda/cycamore:stable - Success :white_check_mark:

stompsjo commented 4 months ago

i remember thinking about the difference between prototypes and agents in this, but didn't spot this either. Did it fail, or just produce less-than-useful graphs?

I failed with a ValueError 🙃 Looking back now I realize there's not a unit test for the graph function. Since we already have a test database in the tests, it might be worthwhile to add a test that simply runs flow_graph and is successfully if there are no errors.