Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #462 +/- ##
==========================================
- Coverage 95.47% 95.13% -0.34%
==========================================
Files 31 32 +1
Lines 4658 4732 +74
Branches 4658 4732 +74
==========================================
+ Hits 4447 4502 +55
- Misses 106 119 +13
- Partials 105 111 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
alexdewar
left a comment
There was a problem hiding this comment.
I think this is fine for now, but I suspect in future we'll mostly want to find agents' search spaces by looking them up with a year and a commodity ID, in which case some kind of map would probably make more sense (e.g. HashMap<(u32, Rc<str>), SearchSpace).
It surprised me that you weren't getting an error when reading in agent_search_space.csv because it's empty and we decided to disallow empty CSV files way back when. In this case, I guess it might make sense for users to not provide any search spaces, but for things like processes and agents we probably want to make sure that the file's not empty, so it would be worth opening an issue for this, I think. If you want to allow empty/missing files for this case you could add a read_csv_optional function or something (see also #106).
| /// Unique agent id identifying the agent this search space belongs to | ||
| pub agent_id: String, |
There was a problem hiding this comment.
I'd be tempted to drop this field because we shouldn't need it (though there are some unneeded process IDs lurking around as well: #443)
|
Thanks @alexdewar . Yeah I'm sure the structure of this will change down the line, mostly just concerned about getting the data into the program for now I'll open up a different PR to deal with empty csv files Going the keep the |
Description
This PR breaks out search space into its own table, allowing search space to be defined on a year and commodity basis
I've created the new struct
AgentSearchSpacewhich defines the search space for a given agent/year/commodity process, and I've modified thesearch_spaceattribute ofAgentto be aVec<AgentSearchSpace>I've followed a similar process for reading/validating the data as with several other tables, i.e.
AgentSearchSpaceRaw,read_agent_search_space,read_agent_search_space_from_iterThere's some validation (checking the commodity and processes exist, checking the milestone year is valid), but still more to be done after #453
I imagine this could change a lot after #453 and #444, but it works for now
Fixes #456
Type of change
Key checklist
$ cargo test$ cargo docFurther checks