@@ -10,73 +10,75 @@ This library supports both Python 2 and Python 3.
10
10
Installation
11
11
------------
12
12
13
- We describe here how to install cypari2. Any other kind of installation
14
- is not supported. In particular, ``python setup.py install `` does NOT work.
15
-
16
13
GNU/Linux
17
14
^^^^^^^^^
18
15
19
- Check if a package `python-cypari2 ` or `python2-cypari2 ` or `python3-cypari2 `
20
- is available through your package manager.
16
+ A package `python-cypari2 ` or `python2-cypari2 ` or `python3-cypari2 ` might be
17
+ available in your package manager.
18
+
19
+ Using pip
20
+ ^^^^^^^^^
21
21
22
- Generic install via PyPI
23
- ^^^^^^^^^^^^^^^^^^^^^^^^
22
+ Requirements:
24
23
25
- 1. Install libpari, pip, cysignals
24
+ - PARI/GP (header files and library)
25
+ - python >= 2.7
26
+ - pip
27
+ - `cysignals <https://pypi.python.org/pypi/cysignals/ >`_
26
28
27
- 2. Install cypari2 via the Python Package Index (PyPI) via::
29
+ Install cypari2 via the Python Package Index (PyPI) via
30
+
31
+ ::
28
32
29
33
$ pip install cypari2 [--user]
30
34
31
35
(the optional option *--user * allows to install cypari2 for a single user
32
- and avoids using pip with administrator rights)
33
-
34
- Development version
35
- ^^^^^^^^^^^^^^^^^^^
36
+ and avoids using pip with administrator rights). Depending on your operating
37
+ system the pip command might also be called pip2 or pip3.
36
38
37
- If you want to try the development version, you can replace step 2
38
- of the "Generic install via PyPI" by
39
+ If you want to try the development version use
39
40
40
41
::
41
42
42
43
$ pip install git+https://github.com/defeo/cypari2.git [--user]
43
44
45
+ Other
46
+ ^^^^^
47
+
48
+ Any other way to install cypari2 is not supported. In particular, ``python
49
+ setup.py install `` will produce an error.
44
50
45
51
Usage
46
52
-----
47
53
48
- Just launch Python and then you can perform some PARI/GP computation
54
+ Here is an example of some PARI/GP computations in Python
49
55
50
56
::
51
57
52
58
>>> import cypari2
53
59
>>> pari = cypari2.Pari()
60
+
54
61
>>> pari(2).zeta()
55
62
1.64493406684823
56
63
64
+ >>> pari(2197).ispower(3)
65
+ (3, 13)
66
+
57
67
>>> K = pari("bnfinit(x^3 - 2)")
58
68
>>> K.bnfunit()
59
69
[x - 1]
60
70
61
- The object **pari ** above is the object for the interface. It can be called
62
- with basic Python objects like integer or floating point. When called with
63
- a string as in the second example above, the corresponding code is interpreted
64
- by libpari
65
-
66
- Any object you get a handle on is of type **Gen ** (that is a wrapper around the
67
- **GEN ** type from libpari). All PARI/GP functions are then available as *method *
68
- of the object **Gen **.
71
+ The object **pari ** above is the object for the interface and acts as a
72
+ constructor. It can be called with basic Python objects like integer
73
+ or floating point. When called with a string as in the last example
74
+ the corresponding string is interpreted as if it was executed in a GP shell.
69
75
70
- Issues
71
- ------
72
-
73
- 1) If you change your PARI installation you need to recompile cysignals and cypari2 using
74
- the *--no-cache-dir * option of pip
75
-
76
- ::
76
+ Beyond the interface object **pari ** of type **Pari **, any object you get a
77
+ handle on is of type **Gen ** (that is a wrapper around the **GEN ** type from
78
+ libpari). All PARI/GP functions are then available in their original names as
79
+ *methods * like **zeta **, **ispower ** or **bnfunit ** above.
77
80
78
- pip install cysignals --no-cache-dir --force-reinstall [--user]
79
- pip install cypari2 --no-cache-dir --force-reinstall [--user]
81
+ The complete documentation is available at http://cypari2.readthedocs.io
80
82
81
83
Contributing
82
84
------------
0 commit comments