Skip to content

Commit 8e3565d

Browse files
author
Christopher Doris
committed
rename modules
1 parent 306837f commit 8e3565d

16 files changed

Lines changed: 72 additions & 75 deletions

File tree

src/C/C.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
module _CPython
2+
module PythonCall.C
33
44
This module provides a direct interface to the Python C API.
55
"""
6-
module _CPython
6+
module C
77

88
using Base: @kwdef
99
using UnsafePointers: UnsafePtr
@@ -12,11 +12,6 @@ using Pkg: Pkg
1212
using Requires: @require
1313
using Libdl: dlpath, dlopen, dlopen_e, dlclose, dlsym, dlsym_e, RTLD_LAZY, RTLD_DEEPBIND, RTLD_GLOBAL
1414

15-
# import Base: @kwdef
16-
# import CondaPkg
17-
# import Pkg
18-
# using Libdl, Requires, UnsafePointers, Serialization, ..Utils
19-
2015
include("consts.jl")
2116
include("pointers.jl")
2217
include("extras.jl")

src/Compat/Compat.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
2-
module _compat
2+
module PythonCall.Compat
33
44
Misc bits and bobs for compatibility.
55
"""
6-
module _compat
6+
module Compat
77
using ..PythonCall: PythonCall # needed for docstring cross-refs
8-
using .._Py
9-
using .._Py: C, Utils, pynew, incref, getptr, pycopy!, pymodulehooks, pyisnull, pybytes_asvector, pysysmodule, pyosmodule, pystr_fromUTF8
10-
using .._pyconvert: pyconvert, @pyconvert
11-
using .._pywrap: PyPandasDataFrame
8+
using ..Core
9+
using ..Core: C, Utils, pynew, incref, getptr, pycopy!, pymodulehooks, pyisnull, pybytes_asvector, pysysmodule, pyosmodule, pystr_fromUTF8
10+
using ..Convert: pyconvert, @pyconvert
11+
using ..Wrap: PyPandasDataFrame
1212
using Serialization: Serialization, AbstractSerializer, serialize, deserialize
1313
using Tables: Tables
1414
using Requires: @require

src/Convert/Convert.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
module PythonCall.Convert
3+
4+
Implements `pyconvert`.
5+
"""
6+
module Convert
7+
8+
using ..Core
9+
using ..Core: C, Utils, @autopy, getptr, incref, pynew, PyNULL, pyisnull, pydel!, pyisint, iserrset_ambig, pyisnone, pyisTrue, pyisFalse, pyfloat_asdouble, pycomplex_ascomplex, pyisstr, pystr_asstring, pyisbytes, pybytes_asvector, pybytes_asUTF8string, pyisfloat, pyisrange, pytuple_getitem, unsafe_pynext, pyistuple, pydatetimetype, pytime_isaware, pydatetime_isaware, _base_pydatetime, _base_datetime, errmatches, errclear, errset, pyiscomplex, pythrow, pybool_asbool
10+
using Dates: Date, Time, DateTime, Millisecond
11+
12+
import ..Core: pyconvert
13+
14+
include("pyconvert.jl")
15+
include("rules.jl")
16+
include("ctypes.jl")
17+
include("numpy.jl")
18+
include("pandas.jl")
19+
20+
function __init__()
21+
C.with_gil() do
22+
init_pyconvert()
23+
init_ctypes()
24+
init_numpy()
25+
init_pandas()
26+
end
27+
end
28+
29+
end

src/Core/Core.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
"""
2-
module _Py
2+
module PythonCall.Core
33
44
Defines the `Py` type and directly related functions.
55
"""
6-
module _Py
6+
module Core
77

88
const VERSION = v"0.9.15"
99
const ROOT_DIR = dirname(dirname(@__DIR__))
1010

1111
using ..PythonCall: PythonCall # needed for docstring cross-refs
12-
using .._CPython: _CPython as C
13-
using .._Utils: _Utils as Utils
12+
using ..C: C
13+
using ..GC: GC
14+
using ..Utils: Utils
1415
using Base: @propagate_inbounds, @kwdef
1516
using Dates: Date, Time, DateTime, year, month, day, hour, minute, second, millisecond, microsecond, nanosecond
1617
using MacroTools: @capture
1718
using Markdown: Markdown
18-
# using MacroTools, Dates, Tables, Markdown, Serialization, Requires, Pkg, REPL
1919

20-
include("gc.jl")
2120
include("Py.jl")
2221
include("err.jl")
2322
include("config.jl")

src/Core/gc.jl renamed to src/GC/GC.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
"""
2+
module PythonCall.GC
3+
24
Garbage collection of Python objects.
35
46
See `disable` and `enable`.
57
"""
68
module GC
79

8-
using .._Py: C
10+
using ..C: C
911

1012
const ENABLED = Ref(true)
1113
const QUEUE = C.PyPtr[]

0 commit comments

Comments
 (0)