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

Add support for higher-order JSON descriptions #70

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

davschneller
Copy link
Contributor

@davschneller davschneller commented Feb 15, 2024

(to match the new format in the SeisSol/Matrices repository)

else:
shape = m['shape']
dim = len(shape)
if len(next(iter(entries))) == dim:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next(iter(entries))) will be always the first item of the iteration. Is that what you want?

Copy link
Contributor Author

@davschneller davschneller Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware (it's from the previous code), it's supposed to do exactly that:

  • an entry of length dim will only encode a sparsity pattern
  • an entry of length (dim+1) will encode a value as well

(it's not a very ideal solution, arguably; at least if we consider the special case of null matrices—but so far it worked good enough ... More ideal would probably be to mark the type in the header, next to the tensor shape)

@davschneller davschneller merged commit b4f17fa into master Mar 27, 2024
5 checks passed
@davschneller davschneller deleted the davschneller/json-ho-tensors branch March 27, 2024 10:07
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