HajimeKawahara / exojax

🐈 Automatic differentiable spectrum modeling of exoplanets/brown dwarfs using JAX, compatible with NumPyro and JAXopt
http://secondearths.sakura.ne.jp/exojax/
MIT License
45 stars 14 forks source link

__eq__ methods in opa and mdb #509

Closed HajimeKawahara closed 1 month ago

HajimeKawahara commented 1 month ago

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

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 commented 1 month ago

done by #512