Skip to content

Commit 891fcb7

Browse files
author
Christopher Doris
committed
docs
1 parent 443dd10 commit 891fcb7

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

docs/make.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ makedocs(
3535
modules = [PythonCall],
3636
pages = [
3737
"Home" => "index.md",
38-
"pythoncall.md",
39-
"juliacall.md",
40-
"conversion-to-python.md",
41-
"conversion-to-julia.md",
38+
"The Julia module PythonCall" => [
39+
"Guide" => "pythoncall.md",
40+
"Reference" => "pythoncall-reference.md",
41+
],
42+
"The Python module JuliaCall" => [
43+
"Guide" => "juliacall.md",
44+
"Reference" => "juliacall-reference.md",
45+
],
46+
"Conversion" => [
47+
"Julia to Python" => "conversion-to-python.md",
48+
"Python to Julia" => "conversion-to-julia.md",
49+
],
4250
"compat.md",
43-
"pythoncall-reference.md",
44-
"juliacall-reference.md",
4551
"pycall.md",
4652
"releasenotes.md",
4753
]

docs/src/compat.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ Whenever a Python exception is displayed by Julia, `sys.last_traceback` and frie
1010

1111
## Tabular data & Pandas
1212

13-
A `pandas.DataFrame` can be wrapped in Julia as a [`PyPandasDataFrame`](@ref), providing a `Tables.jl`-compatible interface.
13+
The abstract type [`PyTable`](@ref) is for wrapper types around Python tables, providing the
14+
[Tables.jl](https://github.com/JuliaData/Tables.jl) interface. `PyTable(x)` is shorthand
15+
for `pyconvert(PyTable, x)`.
1416

15-
Furthermore, any Python object which can be converted to a `PyTable` (e.g. `pandas.DataFrame` can be converted to `PyPandasDataFrame`) satisfies the Tables.jl interface.
17+
The subtype [`PyPandasDataFrame`](@ref) wraps a `pandas.DataFrame`.
1618

17-
In the other direction, the following functions can be used to convert any `Tables.jl`-compatible table to a Python table.
19+
For example, if `x` is a `pandas.DataFrame` then `PyTable(x)` is a `PyPandasDataFrame` and
20+
`DataFrame(PyTable(x))` is a [`DataFrame`](https://github.com/JuliaData/DataFrames.jl).
21+
22+
In the other direction, the following functions can be used to convert any
23+
`Tables.jl`-compatible table to a Python table.
1824

1925
```@docs
2026
pytable

docs/src/pythoncall-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PythonCall API Reference
1+
# [PythonCall API Reference](@id py-reference)
22

33
## `Py` objects
44

docs/src/pythoncall.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Python list: [3, 4, 1, 2]
6464
We have just seen the functions [`pylist`](@ref) (for constructing a Python list) and
6565
[`pyslice`](@ref) (for constructing a Python slice). There are many such functions,
6666
mirroring most of the Python builtin functions and types. The
67-
[API Reference](@ref PythonCall API Reference) documents them all.
67+
[API Reference](@ref py-reference) documents them all.
6868

6969
Most of these functions are essentially Python builtins with a `py` prefix. For example
7070
`pyint(x)` converts `x` to a Python `int` and is equivalent to `int(x)` in Python when `x`
@@ -132,10 +132,10 @@ In the above example, we converted a Python list to a Julia vector in three ways
132132
See [here](@ref py2jl) for the rules regarding how `pyconvert(T, x)` works. If `x` is an
133133
immutable scalar type (such as an `int` or `str`) then `pyconvert(Any, x)` may return the
134134
corresponding Julia object (such as an `Integer` or `String`). Otherwise it will typically
135-
return either a [wrapper type](@ref Wrapper types) (such as `PyList{Py}` in the above
135+
return either a [wrapper type](@ref py-wrappers) (such as `PyList{Py}` in the above
136136
example) or will fall back to returning a [`Py`](@ref).
137137

138-
## Wrapper types
138+
## [Wrapper types](@id py-wrappers)
139139

140140
A wrapper is a type which wraps a Python object but provides it with the semantics of some
141141
other Julia type.

src/Py.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ getptr(x) = ispy(x) ? getptr(Py(x)::Py) : throw(MethodError(getptr, (x,)))
3030
3131
Convert `x` to a Python object, of type `Py`.
3232
33-
Conversion happens according to [`these rules`](@ref jl2py-conversion).
33+
Conversion happens according to [these rules](@ref jl2py-conversion).
3434
3535
Such an object supports attribute access (`obj.attr`), indexing (`obj[idx]`), calling
3636
(`obj(arg1, arg2)`), iteration (`for x in obj`), arithmetic (`obj + obj2`) and comparison

0 commit comments

Comments
 (0)