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

Extend Step String Tagging Functionality #4177

Open
mleot opened this issue Jun 14, 2024 · 1 comment · May be fixed by #4178
Open

Extend Step String Tagging Functionality #4177

mleot opened this issue Jun 14, 2024 · 1 comment · May be fixed by #4178
Labels

Comments

@mleot
Copy link
Contributor

mleot commented Jun 14, 2024

Description

This is a feature request covering multiple related feature additions surrounding the pybamm.step.string tags functionality. Currently there is the ability to add tags to pybamm step strings, and there is the ability to search an experiment for the indices where specific tags exist. There is not currently any additional functionality of the step string tags. The proposed added functionality is the following:

  • The ability to search a solution object for specific steps based on tags
  • The added functionality to export tags along with cycle and step indices when using the Solution.get_data_dict() method

Motivation

I believe these features are the would-be natural evolution of additional functionality surrounding step string tags. I believe the true utility of these step string tags come when you can use them to filter a solution object, or to filter data exported from a solution object.

Possible Implementation

Core Implementation

I believe there are a number of steps for the proposed core implementation.

  1. Add a property to the Solution class: .tags
  2. By default, when running an experiment, each time a step_solution is generated, the tags from the associated step (from the experiment) should then be assigned as a property to the Solution object
  3. The method Solution.get_data_dict() should export a 'Tags' column along with 'Cycle' and 'Step' columns.
  4. An additional method should be added: Solution.search_tags(), similar to Experiment.search_tag(), allowing for searching of one of many tags in the solution sub_solutions

Additional Features

I also believe there are a number of additional changes that may be useful to include as well

  1. The inclusion of tags in the __repr__ of the Solution object
  2. Similar to how tags would be associated with a Solution object (as a property), there may also be the properties .cycle and .step which are associated with a Solution when the solution results from an experiment.
  3. The Solution object holds the additional variables, accessible through the __getitem__() method, being "Cycle", "Step", and "Tags"

Remaining Questions

  • Should calling Solution.get_data_dict() when there are no tags result in returning an empty "Tags" column, or no "Tags" column at all?

Additional context

No response

@mleot mleot added the feature label Jun 14, 2024
@mleot mleot linked a pull request Jun 14, 2024 that will close this issue
8 tasks
@valentinsulzer
Copy link
Member

Should calling Solution.get_data_dict() when there are no tags result in returning an empty "Tags" column, or no "Tags" column at all?

I think an empty tags column is better for consistency

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

Successfully merging a pull request may close this issue.

2 participants