-
Notifications
You must be signed in to change notification settings - Fork 41
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
Dimension mismatch: DimSelectors
with alphabetized labels
#798
Comments
Ok right interesting use case. We should use the order from You can probably specifically set the order to Unordered : Vertical(A_locations; order=DimensionalData.Unordered()) And it will work. But, maybe Categorical lookups should be We should also ignore the order if the length is one. I'm changing how some of these correctness checks work in the next breaking release, so we can fix this at the same time. |
Looks like this is no longer broken after the other changes that are coming, but by using Aldo FYI you can define a DimArray like this: A = rand(Vertical(A_locations)) |
Great advice, thank you. I confirm that the I forgot about the streamlined way to make a random DimArray. Nice! I see Categorical lookups as mostly being used in small-ish problems where custom labels make sense. The slowdown from using an Unordered Dimension wouldn't matter much in these cases. So I see the Unordered solution as being a good one for my test case. In bigger problems, some other kind of numerical, Ordered Dimension would be used instead. Also, I agree that the order doesn't make much sense when there's just one element. It was pretty nifty to submit an issue at night and instantaneously have a solution in the morning -- cheers! |
This works now in the latest version |
I have been using Dimensions that use English-word labels. When using
DimSelectors
, the alphabetical order of the labels may change, leading to a change in the "order" of the Dimension. Some algebraic functions, like subtraction (below), then no longer work. Here's a MWE. Any advice is appreciated!The text was updated successfully, but these errors were encountered: