Skip to content

Commit 9619312

Browse files
committed
enhanced README
1 parent 7220cc5 commit 9619312

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

README.rst

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,73 +10,75 @@ This library supports both Python 2 and Python 3.
1010
Installation
1111
------------
1212

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-
1613
GNU/Linux
1714
^^^^^^^^^
1815

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+
^^^^^^^^^
2121

22-
Generic install via PyPI
23-
^^^^^^^^^^^^^^^^^^^^^^^^
22+
Requirements:
2423

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/>`_
2628

27-
2. Install cypari2 via the Python Package Index (PyPI) via::
29+
Install cypari2 via the Python Package Index (PyPI) via
30+
31+
::
2832

2933
$ pip install cypari2 [--user]
3034

3135
(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.
3638

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
3940

4041
::
4142

4243
$ pip install git+https://github.com/defeo/cypari2.git [--user]
4344

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.
4450

4551
Usage
4652
-----
4753

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
4955

5056
::
5157

5258
>>> import cypari2
5359
>>> pari = cypari2.Pari()
60+
5461
>>> pari(2).zeta()
5562
1.64493406684823
5663

64+
>>> pari(2197).ispower(3)
65+
(3, 13)
66+
5767
>>> K = pari("bnfinit(x^3 - 2)")
5868
>>> K.bnfunit()
5969
[x - 1]
6070

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.
6975

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.
7780

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
8082

8183
Contributing
8284
------------

0 commit comments

Comments
 (0)