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

Upgrade to cypari2 #1

Closed
wants to merge 7 commits into from
Closed

Upgrade to cypari2 #1

wants to merge 7 commits into from

Conversation

saraedum
Copy link

No description provided.

@saraedum
Copy link
Author

I would like to package this for conda-forge. However, cypari is not on conda-forge but cypari2 is which is probably better anyway…

@saraedum
Copy link
Author

cypari vendors pari it seems. So some changes are needed to make the CI happy again.

If you are in general fine with this, I can try to fix the CI.

@videlec
Copy link

videlec commented Jul 14, 2019

cypari2 is not an upgrade of cypari but a fork. The main reason why cypari still exists is because

  • it supports Windows (now, cypari2 should also thanks to cysignals #63)
  • it provides binary wheels which package all together: gmp, cysignals, pari and the Python interface (see cypari2 #19). This simplifies the installation procedure for users (that do not have a distribution).

@saraedum
Copy link
Author

Thanks for the clarification. So, what about making realalg work with cypari & cypari2, whichever is available?

@videlec
Copy link

videlec commented Jul 14, 2019

I think this would be reasonable (especially if people are using SageMath which is bundled with cypari2). However it will be delicate to make the setup.py script of realalg to handle the dependencies correctly. How do you specify alternative dependencies?

whichever is available. Giving the precedence to cypari2 since it likely
links against a newer PARI.
@saraedum
Copy link
Author

I don't think this can be done. The sane approach seems to not have an explicit dependency in setup.py but throw an exception if neither is installed that tells you what you should do.

@videlec
Copy link

videlec commented Jul 14, 2019

Much less user friendly than an explicit dependency...

@saraedum
Copy link
Author

I don't disagree but unfortunately setup.py has no hooks to do something like this. The other option is to split this into two pypi packages with different dependencies but I don't think that this is very helpful either.

we can not provide cypari2 and its dependencies with tox easily as they
are not on pip.
@videlec
Copy link

videlec commented Jul 19, 2019

@MarkCBell Because of #3 it would be nice to allow both cypari or cypari2.

(BTW, I expect https://github.com/flatsurf/pyeantic (mostly written in C) to be much faster...)

@videlec
Copy link

videlec commented Jul 19, 2019

In azure and appveyor Python 3.5, 3.6 and 3.7 we got

py35 run-test: commands[0] | py.test --hypothesis-profile=ci --duration=20 --junitxml=results.xml
ERROR: usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --duration=20
  inifile: /home/vsts/work/1/s/tox.ini
  rootdir: /home/vsts/work/1/s

ERROR: InvocationError for command /home/vsts/work/1/s/.tox/py35/bin/py.test --hypothesis-profile=ci --duration=20 --junitxml=results.xml (exited with code 4)

realalg/algebraic.py Outdated Show resolved Hide resolved
@videlec
Copy link

videlec commented Jul 19, 2019

The test failure has nothing to do with @saraedum branch, see #4

@saraedum
Copy link
Author

saraedum commented Oct 2, 2019

@MarkCBell @videlec tests pass now.

@videlec
Copy link

videlec commented Feb 12, 2020

See also the related MarkCBell/flipper#3

import sympy as sp
try:
Copy link

Choose a reason for hiding this comment

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

Independently of the installation procedure, this try/except in the code is an improvement!

@MarkCBell
Copy link
Owner

Sorry for the delay but I think I finally have a solution for this. I've now written a number of interfaces to backends that use cypari, cypari2 and sympy. This means that the only required dependency is now sympy. So if used on its own then realalg will fall back on its sympy implementation which is good enough to allow users to run basic examples (slowly). However if it can import cypari or cypari2 then it will use these, allowing larger more complex examples to be done.

The latest version of realalg (0.2.2) has this functionality. Let me know what you think.

@videlec
Copy link

videlec commented Feb 19, 2020

Very good! Thanks.

You can definitely close this merge request.

@MarkCBell MarkCBell closed this Feb 19, 2020
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