Skip to content

Pytest evaluators2#150

Merged
mmatera merged 14 commits intomasterfrom
pytest_evaluators2
Feb 21, 2022
Merged

Pytest evaluators2#150
mmatera merged 14 commits intomasterfrom
pytest_evaluators2

Conversation

@mmatera
Copy link
Copy Markdown
Contributor

@mmatera mmatera commented Feb 5, 2022

the same as #145 but without changing the name apply_N->eval_N

Comment thread mathics/core/evaluators.py
@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 20, 2022

@mmatera I apologize for not having gotten this merged in before my leaves -> elements disruption.

I tried to resolve the merge conflicts, but I couldn't this is to large and complex and I just don't understand it all that well.

Would you please resolve the merge conflicts so we could merge this. It might be useful in this regard to split it up into smaller PRs.

Possibly next week (not this week), I'd like to continue with replacing "leaves" with "elements" when that is what we mean. And in particular replacing the @leaves property on Expression with @elements would probably be the next thing. (And then after that we probably could replace .get_elements() with .elements and things would be simpler and tidier.

So it would be good to fix this and any outstanding PRs that may cause conflicts.

Many thanks.

@mmatera
Copy link
Copy Markdown
Contributor Author

mmatera commented Feb 20, 2022

OK, I think I can handle it.

@mmatera
Copy link
Copy Markdown
Contributor Author

mmatera commented Feb 20, 2022

Do you have an example, then this rule will apply? In the best case b^a is returned, so no change?

0^a can not be evaluated in general, however, Simplify[0^a,Assumptions-> a>0] evaluates to 0.
The second rule, for a^b tries to ensure that a^0 simplifies to 1 if a!=0. However, in WMA (and in Mathics) a^0 evaluates to 1 even if a could be 0, so in the current state, that rule is irrelevant.

@mmatera mmatera merged commit 649e5bb into master Feb 21, 2022
@mmatera
Copy link
Copy Markdown
Contributor Author

mmatera commented Feb 21, 2022

@rocky, I merge this before merging your new PR to avoid further file conflicts.

@TiagoCavalcante TiagoCavalcante deleted the pytest_evaluators2 branch February 21, 2022 01:07
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