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

__eq__ methods in opa and mdb #509

Closed
2 tasks done
HajimeKawahara opened this issue Aug 9, 2024 · 1 comment
Closed
2 tasks done

__eq__ methods in opa and mdb #509

HajimeKawahara opened this issue Aug 9, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@HajimeKawahara
Copy link
Owner

HajimeKawahara commented Aug 9, 2024

I would define eq methods (and neq ) in ExoJAX classes to enable to use == (and !=) operators.

  • opa
  • mdb

The use of the comparison of __dict__ (the following code) did not work:

    def __eq__(self, other):
        if isinstance(other, MyClass):
            return self.__dict__ == other.__dict__
        return False

So, we decided to compare the attributes directly.

@HajimeKawahara HajimeKawahara self-assigned this Aug 9, 2024
@HajimeKawahara HajimeKawahara added the enhancement New feature or request label Aug 9, 2024
@HajimeKawahara HajimeKawahara added this to the v1.6 milestone Aug 9, 2024
@HajimeKawahara HajimeKawahara changed the title __eq__ methods in ExoJAX classes __eq__ methods in opa and mdb Aug 10, 2024
@HajimeKawahara
Copy link
Owner Author

done by #512

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

No branches or pull requests

1 participant