Conversation
… to be used Big issue is that use of store requires significant rewrite of most resource-based code, and this can lead to errors creeping in around resource release. This adds a new store class - the VidigiStore - that can use the familiar .request() and with: syntax, hopefully minimizing the work required to incorporate vidigi into existing simpy projects.
Claude has rewritten this to be more similar to simpy's implementation internally because resources were seemingly getting released but not being then picked up for use until a few events later. Rewrite sorts this.
Store wrappers
…f work for #51 Column names were hardcoded to 'minutes', which made the logic hard to follow when adding in more flexibility to support a wider range of time unit displays. Have made the naming of time columns more unit-agnostic, and also allowed flexibility in naming of the core columns required in the input dataframes.
…time in the simulation animation slider (addressing #51)
Bugfix 51 time setting
Was already only supporting 3.9 elsewhere and it's a hard req for introducing pydantic
… (the old default expectation). Fix a few remaining places where 'patient' incorrectly hardcoded. Need to add this into the migration guide.
…r on rerun - addresses #71
…rap-bug-icon-size Huge v1.0 feature and fix branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.0.0
Migration guide below!
Changelog
BREAKING CHANGES
VidigiPriorityStoreVidigiPriorityStorehas been renamed toVidigiPriorityStoreLegacyentity_col_name="patient"to each of these functions.Utils.vidigi.resourcesvidigi.loggingicon_and_text_sizehas been removed and replaced with separate parametersresource_icon_sizeentity_icon_sizetext_sizegap_between_rowshas been removed and replaced with separate parameters for queues and resourcesgap_between_queue_rowsgap_between_resource_rowsinit_itemsargument for VidigiStore and VidigiPriorityStore has been replaced withnum_resources. Defaulting to none, this functions identically to thepopulate_storesfunction, but instead allows you to initialise the resource on start.NEW FEATURES:
Adds
VidigiStoreclass to replace use of standard storeThe benefit of these new classes is that they allow the common resource requesting patterns to be used
So
will work when using a VidigiStore or VidigiPriorityStore - mimicking the syntax of making a request from resources - while supporting the inclusion of a resource ID attribute (not possible with traditional simpy resources) that is necessary to grab for simpy.
To access the attribute, it does necessitate some small change -
So
req.id_attributewould not workbut
nurse_resource.id_attributewouldThis is hopefully still a far less substantial change than was required previously, where models using resources had to switch to using
.get()and.put().Further testing still required for more complex request logic that incorporates aspects like reneging.
Additional new features:
entity_col_name,event_col_name,event_type_col_name,resource_col_name", "time_col_name", "pathway_col_namefrom vidigi.logging import EventLogger)from vidigi.utils import EventPosition, create_event_position_df)from vidigi.animation import add_repeating_overlayBUGFIXES
OTHER
🚀 Migration Guide:
vidigi0.0.4 → 1.0.0This guide will help you update your code and workflows to work with
vidigiversion 1.0.0, which includes breaking changes, new features, and important bug fixes.1. Default Entity Column Name
Was:
'patient'Now:
'entity_id'Update your function calls OR change your entity ID column name to entity_id:
2. Module Reorganization
Some classes and functions have moved:
vidigi.utils.VidigiPriorityStorevidigi.resources.VidigiPriorityStoreLegacyUpdate your import statements accordingly.
3. Visual Parameter Changes
icon_and_text_size→ replaced with:resource_icon_sizeentity_icon_sizetext_sizegap_between_rows→ replaced with:gap_between_queue_rowsgap_between_resource_rows4.
CustomResourceRenamedCustomResourceis nowVidigiResource.This is typically used indirectly through
VidigiStoreorVidigiPriorityStore, so minimal changes may be needed unless you were using it directly.5. Resource Initialization Parameter
init_itemshas been replaced withnum_resourcesinVidigiStoreandVidigiPriorityStore.Example:
Before
resource_store = VidigiStore(simulation_env, init_items=[...])OR
resource_store = simpy.Store(simulation_env)populate_store(5, resource_store, simulation_env)After
resource_store = VidigiStore(simulation_env, num_resources=3)✨ New Features
✅ Flexible Column Names
You can now customize column names in the animation and animation prep functions, meaning you are no longer tied to using 'patient' for your entity IDs!
entity_col_nameevent_col_nameevent_type_col_nameresource_col_nametime_col_namepathway_col_nameDefaults are
(note 'pathway' is an optional column you may choose not to populate)
✅ What You Should Do
If you run into issues or have questions, check out the documentation or open an issue on the repo. Thanks for upgrading!