Skip to content

Commit

Permalink
This pattern is good, just need to figure out the best way to put it …
Browse files Browse the repository at this point in the history
…into Python
  • Loading branch information
FadiShawki committed Feb 20, 2024
1 parent a7eda5f commit 0c8eb45
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions environments/python/orbitmines/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ def as_terminal(self) -> Ray: return (
def is_orbit(a, b: Arbitrary) -> Ray: raise NotImplementedError # a.___instance === b.___instance
__eq__ \
= is_orbit

# -__eq__ == __ne__
# @ray
# def __ne__(a, b: Arbitrary) -> Ray: raise NotImplementedError

@ray # TODO
def is_none(self) -> Ray: return self.is_orbit(self, self.self)

Expand Down Expand Up @@ -410,11 +415,23 @@ def __floordiv__(self, item): raise NotImplementedError
def __invert__(self): raise NotImplementedError
def __lshift__(self, item): raise NotImplementedError
def __pos__(self): raise NotImplementedError
def __lt__(a, b: Arbitrary) -> Ray: raise NotImplementedError

@ray
def less_than(self) -> Ray: return (
-self.greater_than_or_equal_to
)
__lt__ \
= less_than
@ray
def greater_than_or_equal_to(self) -> Ray: return (
-self.less_than
)
__ge__ \
= greater_than_or_equal_to
@ray
def __gt__(a, b: Arbitrary) -> Ray: raise NotImplementedError
def __ge__(a, b: Arbitrary) -> Ray: raise NotImplementedError
@ray
def __le__(a, b: Arbitrary) -> Ray: raise NotImplementedError
def __ne__(a, b: Arbitrary) -> Ray: raise NotImplementedError

#
# Opposite aliases
Expand Down

0 comments on commit 0c8eb45

Please sign in to comment.