Open
Conversation
…ous cell parameters (cannot use dict_to_h5 with dolfin.Function type)
…and load homogeneous and heterogeneous parameters separately, as two distinct dictionaries) + fix dict_to_h5 function to avoid overwriting h5 files (but require to make all dict_to_h5 calls before any HDF5File.write(...))
finsberg
reviewed
Aug 9, 2022
finsberg
reviewed
Aug 26, 2022
Comment on lines
+41
to
+60
| if h5file.keys() != "": | ||
| # Creating a temporary h5file and copy to initial file to avoid overwriting | ||
| # FIXME : Is there a more elegant way to do this ? | ||
| if isinstance(h5name, str): | ||
| tmp_name = str(os.path.splitext(h5name)[0]) + "_tmp.h5" | ||
| elif isinstance(h5name, os.PathLike): | ||
| tmp_name = h5name.with_name(f"{h5name.stem}_tmp.h5") | ||
| else: | ||
| logger.error( | ||
| "dict_to_h5 : h5name has wrong type (supported : str / path)", | ||
| ) | ||
|
|
||
| with h5pyfile(tmp_name, "w") as h5file_tmp: | ||
| if h5group == "": | ||
| group = h5file_tmp | ||
| else: | ||
| group = h5file_tmp.create_group(h5group) | ||
| for k, v in data.items(): | ||
| group.create_dataset(k, data=v) | ||
| h5file_tmp.copy(group, h5file, name=h5group) |
Member
There was a problem hiding this comment.
Just trying to understand what you want to do here. I check if h5file.keys() != "" which should be equivalent of saying that the file exist, right?
And if it does exist then you copy all the data to a new temporary file?
finsberg
reviewed
Aug 26, 2022
Comment on lines
+228
to
+229
| # FIXME : Might be worth moving to a dedicated function | ||
| # Update cellmodel in case of heterogeneous tissue |
Member
There was a problem hiding this comment.
Agree, we should move this to a dedicated function.
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.
Support heterogeneous tissue parametrization from :
{ "scale_ICaL": { "1": 1.02, "2": 1.01 }, "scale_INaL": { "1": 2.3, "2": 2.1 } }