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

Fix tests arithm scalar #288

Merged
merged 14 commits into from
Oct 31, 2023
Merged

Fix tests arithm scalar #288

merged 14 commits into from
Oct 31, 2023

Conversation

DonBraulio
Copy link
Collaborator

@DonBraulio DonBraulio commented Oct 19, 2023

⚠️ Important:

  • Moved tp.equal() to evset.equal(other_evset / scalar_value).

  • Also: Removed unary operators from __init__ (tp.log(), tp.abs(), tp.isnan()), since they were already in event_set_ops.

Tests restructured in this PR:

  • Arithmetic scalar tests
  • Arithmetic tests (evsets)
  • Unary tests
  • Logical tests
  • Relational / relational scalar tests

For a future PR: we should probably remove ops. that are already overloaded from __init__, such as tp.greater_equal(). Unless there a good reason to have 2 ways to do that.

@DonBraulio DonBraulio marked this pull request as ready for review October 24, 2023 20:24
@DonBraulio DonBraulio force-pushed the fix-tests-arithm-scalar branch from a686763 to daf38e0 Compare October 25, 2023 14:28
@github-actions
Copy link

Coverage report

Main: 90.85% | PR: 90.85% | Diff: 0.00 ✅

@google google deleted a comment from github-actions bot Oct 26, 2023
@google google deleted a comment from github-actions bot Oct 26, 2023
@google google deleted a comment from github-actions bot Oct 26, 2023
@google google deleted a comment from github-actions bot Oct 26, 2023
Copy link
Collaborator

@ianspektor ianspektor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👍🏼

@@ -78,11 +83,6 @@ Check the index on the left for a more detailed description of any symbol.
| [`tp.equal()`][temporian.equal] [`tp.not_equal()`][temporian.not_equal] [`tp.greater()`][temporian.greater] [`tp.greater_equal()`][temporian.greater_equal] [`tp.less()`][temporian.less] [`tp.less_equal()`][temporian.less_equal] | Compute a relational binary operator between two [`EventSets`][temporian.EventSet]. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tp.equal() no longer exists right? I'd move all of the binary ones to the EventSet if we're moving .equal(). @achoum is there a reason we haven't already done this?

Copy link
Collaborator Author

@DonBraulio DonBraulio Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main reason is that we already have the magic methods for those. evset.equal() is needed because we can't overload the == operator. But we do have +, *, >=, etc...

IMO we should remove all these from __init__, without adding them to event_set_ops. I don't see any use case where using these methods instead of python ops is a much better option, and we should try to not have two ways to do things.

(this was the last point I wanted to discuss today)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my side to remove them 👍🏼

temporian/core/operators/test/test_unary.py Outdated Show resolved Hide resolved
@DonBraulio DonBraulio mentioned this pull request Oct 26, 2023
@github-actions
Copy link

Coverage report

Main: 90.85% | PR: 90.85% | Diff: 0.00 ✅

Copy link
Collaborator

@achoum achoum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Copy link

Coverage report

Main: 90.85% | PR: 90.85% | Diff: 0.00 ✅

@DonBraulio DonBraulio merged commit bd9630f into main Oct 31, 2023
19 checks passed
@DonBraulio DonBraulio deleted the fix-tests-arithm-scalar branch October 31, 2023 16:55
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

Successfully merging this pull request may close these issues.

3 participants