You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the reasons why we run into issues like phyloref/klados#263 is that there is no way to compare phyx.js components that represent identical concepts, e.g. two phylorefs that have the same two internal specifiers, but one of which is missing an .externalSpecifiers field while the other one sets it to an empty list. This means that you can load a file into Klados containing the former, add an external specifier, then delete that external specifier, and Klados will tell you that your file has been modified even though it is still essentially the same file.
We currently determine if the file has changed by doing an exact deep comparison using lodash.isEqual. A more comprehensive approach would be to add some sort of getNormalized() method to PhyxWrapper, PhylorefWrapper, PhylogenyWrapper and other wrapper classes that return a normalized version of the underlying object. This would include standardization, such as:
Determining whether we would prefer a particular field (such as .externalSpecifiers) to be missing or an empty list if it is not filled in.
Removing fields that are redundant (e.g. genus and specificEpithet, when those can be calculated from binomialName)
The text was updated successfully, but these errors were encountered:
One of the reasons why we run into issues like phyloref/klados#263 is that there is no way to compare phyx.js components that represent identical concepts, e.g. two phylorefs that have the same two internal specifiers, but one of which is missing an
.externalSpecifiers
field while the other one sets it to an empty list. This means that you can load a file into Klados containing the former, add an external specifier, then delete that external specifier, and Klados will tell you that your file has been modified even though it is still essentially the same file.We currently determine if the file has changed by doing an exact deep comparison using
lodash.isEqual
. A more comprehensive approach would be to add some sort ofgetNormalized()
method to PhyxWrapper, PhylorefWrapper, PhylogenyWrapper and other wrapper classes that return a normalized version of the underlying object. This would include standardization, such as:.externalSpecifiers
) to be missing or an empty list if it is not filled in.genus
andspecificEpithet
, when those can be calculated frombinomialName
)The text was updated successfully, but these errors were encountered: