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

New Electrum.dimension internal function and upgrades to Electrum.DataSpace methods #189

Merged
merged 8 commits into from
Oct 30, 2023

Conversation

brainandforce
Copy link
Owner

The Electrum.dimension function returns the dimension parameter associated with a DataSpace object. For now, this assumes that the type parameter is an integer, but in the future we may want to handle things like metric tensors which provide some notion of a number of dimensions, but are not integers themselves.

Electrum.DataSpace now has a new fallback when a type is given instead of an object:

DataSpace(::Type{T}) where T = DataSpace(fieldtype(T, :basis))

Therefore, by default, a new type with a basis field will automatically infer from the field's type. This can be overridden if needed for specific types.

@brainandforce brainandforce merged commit ad0c505 into main Oct 30, 2023
2 of 3 checks passed
@brainandforce brainandforce deleted the internal/dimension branch October 30, 2023 18:39
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.

1 participant