Skip to content

Commit ecea7b4

Browse files
author
Christopher Doris
committed
rename python module to juliaaa to avoid name clash; add juliaaa.As
1 parent e94ece6 commit ecea7b4

28 files changed

+174
-116
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In this example, we use `Python.jl` from an IJulia notebook to inspect the Iris
2929

3030
## Example 2: Calling Julia from Python
3131

32-
In this example we use the Python module `julia` from an IPython notebook to train a simple neural network:
32+
In this example we use the Python module `juliaaa` from an IPython notebook to train a simple neural network:
3333
- We generate some random training data using Python's `numpy`.
3434
- We construct and train a neural network model using Julia' `Flux`.
3535
- We plot some sample output from the model using Python's `matplotlib.pyplot`.

docs/src/conversion.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ When a Julia object is converted to a Python one (e.g. by calling `PyObject`, by
1010

1111
The user can always explicitly choose a different conversion (e.g. by calling `pylist` or `pydict`).
1212

13-
| From | To |
14-
| :------------------------------------------------------------------ | :---------------------------------------------- |
15-
| Any Python object type (`PyObject`, `PyList`, etc.) | itself |
16-
| `Nothing`, `Missing` | `None` |
17-
| `Bool` | `bool` |
18-
| Standard integer (`IntXX`, `UIntXX`, `BigInt`) | `int` |
19-
| Standard rational (`Rational{T}`, `T` a standard integer) | `fractions.Fraction` |
20-
| Standard float (`FloatXX`) | `float` |
21-
| Standard complex (`Complex{T}`, `T` a standard float) | `complex` |
22-
| Standard string/char (`String` and `SubString{String}`, `Char`) | `str` |
23-
| `Tuple` | `tuple` |
24-
| Standard integer range (`AbstractRange{T}`, `T` a standard integer) | `range` |
25-
| `Date`, `Time`, `DateTime` (from `Dates`) | `date`, `time`, `datetime` (from `datetime`) |
26-
| `Second`, `Millisecond`, `Microsecond`, `Nanosecond` (from `Dates`) | `timedelta` (from `datetime`) |
27-
| `Number` | `julia.NumberValue`, `julia.ComplexValue`, etc. |
28-
| `AbstractArray` | `julia.ArrayValue`, `julia.VectorValue` |
29-
| `AbstractDict` | `julia.DictValue` |
30-
| `AbstractSet` | `julia.SetValue` |
31-
| `IO` | `julia.BufferedIOValue` |
32-
| `Module` | `julia.ModuleValue` |
33-
| `Type` | `julia.TypeValue` |
34-
| Anything else | `julia.AnyValue` |
13+
| From | To |
14+
| :------------------------------------------------------------------ | :-------------------------------------------------- |
15+
| Any Python object type (`PyObject`, `PyList`, etc.) | itself |
16+
| `Nothing`, `Missing` | `None` |
17+
| `Bool` | `bool` |
18+
| Standard integer (`IntXX`, `UIntXX`, `BigInt`) | `int` |
19+
| Standard rational (`Rational{T}`, `T` a standard integer) | `fractions.Fraction` |
20+
| Standard float (`FloatXX`) | `float` |
21+
| Standard complex (`Complex{T}`, `T` a standard float) | `complex` |
22+
| Standard string/char (`String` and `SubString{String}`, `Char`) | `str` |
23+
| `Tuple` | `tuple` |
24+
| Standard integer range (`AbstractRange{T}`, `T` a standard integer) | `range` |
25+
| `Date`, `Time`, `DateTime` (from `Dates`) | `date`, `time`, `datetime` (from `datetime`) |
26+
| `Second`, `Millisecond`, `Microsecond`, `Nanosecond` (from `Dates`) | `timedelta` (from `datetime`) |
27+
| `Number` | `juliaaa.NumberValue`, `juliaaa.ComplexValue`, etc. |
28+
| `AbstractArray` | `juliaaa.ArrayValue`, `juliaaa.VectorValue` |
29+
| `AbstractDict` | `juliaaa.DictValue` |
30+
| `AbstractSet` | `juliaaa.SetValue` |
31+
| `IO` | `juliaaa.BufferedIOValue` |
32+
| `Module` | `juliaaa.ModuleValue` |
33+
| `Type` | `juliaaa.TypeValue` |
34+
| Anything else | `juliaaa.AnyValue` |
3535

36-
The `julia.*Value` types are all subtypes of `julia.AnyValue`. They wrap a Julia value, providing access to Julia semantics: it can be called, indexed, and so on. Subtypes add additional Pythonic semantics. Read more [here](../juliapy/#Wrapper-types).
36+
The `juliaaa.*Value` types are all subtypes of `juliaaa.AnyValue`. They wrap a Julia value, providing access to Julia semantics: it can be called, indexed, and so on. Subtypes add additional Pythonic semantics. Read more [here](../juliapy/#Wrapper-types).
3737

3838
This conversion policy is defined/implemented by `Python.C.PyObject_From` and `Python.C.PyJuliaValue_From`. Package authors can (carefully) overload these with additional rules for custom types.
3939

@@ -54,7 +54,7 @@ The following table specifies the conversion rules in place. If the initial Pyth
5454
| From | To |
5555
| :----------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
5656
| **Top priority (wrapped values).** | |
57-
| `julia.AnyValue` | `Any` |
57+
| `juliaaa.AnyValue` | `Any` |
5858
| **Very high priority (arrays).** | |
5959
| Objects satisfying the buffer or array interface (inc. `bytes`, `bytearray`, `array.array`, `numpy.ndarray`) | `PyArray` |
6060
| **High priority (canonical conversions).** | |

docs/src/getting-started.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@ pkg"add Python"
1616

1717
This step is only required if you wish to call Julia from Python.
1818

19-
Currently the Python package `julia` is shipped with the source of the Julia package, and must be
19+
Currently the Python package `juliaaa` is shipped with the source of the Julia package, and must be
2020
pip-installed manually. The following should work in most shells (including PowerShell):
2121

2222
```bash
23-
pip install --upgrade $(julia -e "using Python; print(Python.juliapypath)")
23+
pip install --upgrade $(julia -e "using Python; print(dirname(dirname(pathof(Python))))")
2424
```
2525

26-
Note that this is a [very small](https://github.com/cjdoris/Python.jl/blob/master/juliapy/julia/__init__.py)
26+
The package has no dependencies, so you can also just copy it to somewhere in your PYTHONPATH.
27+
28+
Note that this is a [very small](https://github.com/cjdoris/Python.jl/blob/master/juliaaa/__init__.py)
2729
"bootstrap" package whose sole job is to locate and load Julia; the main functionality is in
28-
the main Julia package. Hence it is not necessary to upgrage the Python package every time
29-
you upgrade the Julia one.
30+
the main Julia package. Hence it is not necessary to upgrage `juliaaa` every time
31+
you upgrade `Python`.
3032

31-
Note also that regardless of installing the `julia` package, a module called `julia` will
32-
always be loaded into the interpreter by the `Python` package. This means that other Python
33-
packages can always `import julia`.
33+
Note also that regardless of installing `juliaaa`, a module called `juliaaa` will
34+
always be loaded into the interpreter by `Python`. This means that other Python
35+
packages can always `import juliaaa`.
3436

3537
## Environment variables
3638

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Bringing **Python** and **Julia** together in seamless harmony:
99
- Beautiful stack-traces.
1010
- Works anywhere: tested on Windows, MacOS and Linux, 32- and 64-bit, Julia 1.0 upwards and Python 3.5 upwards.
1111

12-
This is actually two modules working in harmony: a Julia one called `Python` and a [tiny](https://github.com/cjdoris/Python.jl/blob/master/juliapy/julia/__init__.py) Python one called `julia`.
12+
This is actually two modules working in harmony: a Julia one called `Python` and a [tiny](https://github.com/cjdoris/Python.jl/blob/master/juliaaa/__init__.py) Python one called `juliaaa`.

0 commit comments

Comments
 (0)