Repository navigation
Conversation
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.
This addresses a long-standing issue related to having mismatched custom_data variables in different cell_definition blocks of a .xml config file. Recall (or convince yourself) that each cell_definition must have defined the very same custom_data. It also touches on the related issue of using hierarchical cell_definitions with the
parent_typeattribute. For example, if a cell_definition is defined with aparent_type, PhysiCell will automatically create its custom_data to match the parent. Confusion (and errors) can arise when a user tries to add another variable to the custom_data block of just one cell_definition, but not all of them.The
parent_typeattribute may be considered legacy, but it is still very much in use, in spite of PhysiCell Studio basically eliminating it when it saves the .xml model. Also, we still have users editing the .xml by hand and not using the Studio at all.The primary contribution of this PR is to add a validation check for having the very same custom_data in all cell_definitions, regardless of whether they are hierarchical or not. If they fail this validation, the simulation prints an error message and exits. (For anyone asking why the Studio doesn't allow reading in and saving a hierarchical config file, one key reason is that a hierarchical model is not unique. There are pros and cons for both hierarchical and "flat", but for now I still prefer that the Studio save a flat config file. It may increase its size considerably, but it will be very explicit).
To help facilitate the custom_data validation, we added some relevant scripts to
/beta, e.g.,check_custom_data*.py. Going a bit further, we also added a script,xml_hier2flat.py, which attempts to convert a hierarchical config file to a flatttened one (and thereby usable for the Studio).Related to model validation, we also added a
schema.xsdfile andcheck_schema_samples.pyscript. This should be considered a future-looking option of validating a model's definition. This captures a lot of work that we've done with undergrad students over the past year.To help make sense of these new additions to
/beta, the PR adds aREADME.mdthere to help explain all the scripts (and related files) and organize them, functionally.During testing, it was discovered that some of the physimess config files fail the custom_data validation. I have not fixed those but if @vincent-noel or @marcorusc agree that they need fixed, I could offer to do that as part of this PR. As it stands, they will fail when running the github actions tests with this PR. And related to physimess, I would like to propose that the "default" config file,
sample_projects/physimess/config/PhysiCell_settings.xmlbe made a duplicate of one of the (fixed) existing submodels. Currently, it too is invalid.