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

Allow any ordering of xyz kwarg #13

Open
hmacdope opened this issue Jun 13, 2023 · 2 comments
Open

Allow any ordering of xyz kwarg #13

hmacdope opened this issue Jun 13, 2023 · 2 comments

Comments

@hmacdope
Copy link
Member

          It's mentioned above to include any ordering of `xyz`, which I think would be nice. A good way to implement that would be to convert the `dim_type` string to a set and then use sets as the keys here. That would give you flexibility without enumerating every option. e.g.
dim_type = set(self.dim_type.split())

        keys = {
            {"x"}: [0],
            {"y"}: [1],
            {"z"}: [2],
            {"x", "y"}: [0, 1],
            {"x", "z"}: [0, 2],
            {"y", "z"}: [1, 2],
            {"x", "y", "z"}: [0, 1, 2],
        }

self._dim = keys[dim_type]

Originally posted by @orionarcher in #1 (comment)

@xhgchen
Copy link
Member

xhgchen commented Jun 14, 2023

Wait, isn't this a duplicate issue since #6 already exists?

@hmacdope
Copy link
Member Author

Yes but wanted to capture @orionarcher solution. You can combine them and close one.

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

No branches or pull requests

2 participants