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

Update consistency calculation #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mszulcz-mitre
Copy link
Collaborator

This commit addresses Issue #34.

To recreate the problems it addresses:

  • Run SheafBuildingExample.ipynb. Cell 8 should crash.
  • Run linearSheafExample.py. The script should fail due to import errors.

Some of the scripts fail because imports have been commented out.  This
commit uncomments the imports.
…rash

In an older version of the code, Cell in pysheaf.py had the attribute
mExtendedAssignmentConsistancyWeightDivisor that was defaulted to 2.0. In the
new version, it's replaced with mExtendedAssignmentConsistancyWeight that's
defaulted to None. As a result, running Cell 8 in SheafBuildingExample.ipynb
would lead to a norm being computed on an empty array in Line 181 of pysheaf.py
in ComputeConsistency() and would cause a crash.

This commit assigns mExtendedAssignmentConsistancyWeight=0.5 to
reproduce the original behavior of the notebook.
If the mExtendedAssignmentConsistancyWeight is not changed from its
default of None, the code may crash because it may attempt to compute a
norm on an empty array.  This commit updates the code to avoid this
behavior.
@mszulcz-mitre mszulcz-mitre changed the title Update consistency calculation. Update consistency calculation Sep 25, 2024
@mszulcz-mitre
Copy link
Collaborator Author

@kb1dds : I ran some tests and am thinking that the code in this PR isn't sufficient to address the issue. In the current version of the pysheaf.py--including the version in this PR--the default of None for mExtendedAssignmentConsistancyWeight causes consistencies to not be calculated by default unless a cell has an assignment. Is that your desired behavior?

@kb1dds
Copy link
Owner

kb1dds commented Sep 29, 2024 via email

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

Successfully merging this pull request may close these issues.

2 participants