Skip to content
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

Remove parameter reference to availability_estimates dataframe in HealthSystem #1584

Open
tamuri opened this issue Feb 6, 2025 · 2 comments · May be fixed by #1591
Open

Remove parameter reference to availability_estimates dataframe in HealthSystem #1584

tamuri opened this issue Feb 6, 2025 · 2 comments · May be fixed by #1591
Assignees

Comments

@tamuri
Copy link
Collaborator

tamuri commented Feb 6, 2025

Noticed whilst looking at objects holding memory that unnecessary reference to availability_estimates, which is dataframe loaded of ResourceFile_Consumables_availability_small.csv, is not needed after Consumables has been initialised.

# Initialise the Consumables class
self.consumables = Consumables(
availability_data=self.update_consumables_availability_to_represent_merging_of_levels_1b_and_2(
self.parameters['availability_estimates']),
item_code_designations=self.parameters['consumables_item_designations'],
rng=rng_for_consumables,
availability=self.get_cons_availability()
)

Any reason why this can't be a normal variable in read_parameters?

@tbhallett
Copy link
Collaborator

By 'normal variable', you mean something not stored in self.parameters...?

So, in read_parameter we store in as some other member variable? Or something else?

@tamuri
Copy link
Collaborator Author

tamuri commented Feb 6, 2025

Yes, we read the dataframe, pass it to consumables and then it will fall out of scope when the method ends and be cleaned up. Once consumables are set up, I don't think it's needed. Of course, if it's needed for some other lookup we'll need to keep it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants