Skip to content

Commit 8e3565d

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

File tree

16 files changed

+72
-75
lines changed

16 files changed

+72
-75
lines changed

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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

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[]

src/JlWrap/JlWrap.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
2-
module _jlwrap
2+
module PythonCall.JlWrap
33
44
Defines the Python object wrappers around Julia objects (`juliacall.AnyValue` etc).
55
"""
6-
module _jlwrap
6+
module JlWrap
77

88
using ..PythonCall: PythonCall
9-
using .._Py
10-
using .._Py: C, Utils, pynew, @autopy, incref, decref, setptr!, getptr, pyjuliacallmodule, pycopy!, errcheck, errset, PyNULL, pyistuple, pyisnull, pyJuliaError, pydel!, pyistype, pytypecheck, pythrow, pytuple_getitem, pyisslice, pystr_asstring, pyosmodule, pyisstr
9+
using ..Core
10+
using ..Core: C, Utils, pynew, @autopy, incref, decref, setptr!, getptr, pyjuliacallmodule, pycopy!, errcheck, errset, PyNULL, pyistuple, pyisnull, pyJuliaError, pydel!, pyistype, pytypecheck, pythrow, pytuple_getitem, pyisslice, pystr_asstring, pyosmodule, pyisstr
1111
using .._pyconvert: pyconvert, @pyconvert, PYCONVERT_PRIORITY_WRAP, pyconvert_add_rule, pyconvert_tryconvert, pyconvertarg, pyconvert_result
1212

1313
using Pkg: Pkg
1414
using Base: @propagate_inbounds, allocatedinline
1515

16-
import .._Py: Py
16+
import ..Core: Py
1717

1818
include("C.jl")
1919
include("base.jl")

src/PyConvert/PyConvert.jl

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/PyMacro/PyMacro.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
# - splatting
1313

1414
"""
15-
module _pymacro
15+
module PythonCall.PyMacro
1616
1717
Provides the `@py` macro.
1818
"""
19-
module _pymacro
19+
module PyMacro
2020

21-
using .._Py
22-
using .._Py: pyisnot, pynotin, BUILTINS, pynew, pycallargs, pydel!, pycopy!, pystr_intern!, pynulltuple, pytuple_setitem, pyset_add, pyisnull, unsafe_pynext, pydict_setitem, pylist_setitem, pynulllist, pybool_asbool, pythrow
21+
using ..Core
22+
using ..Core: pyisnot, pynotin, BUILTINS, pynew, pycallargs, pydel!, pycopy!, pystr_intern!, pynulltuple, pytuple_setitem, pyset_add, pyisnull, unsafe_pynext, pydict_setitem, pylist_setitem, pynulllist, pybool_asbool, pythrow
2323

2424
using MacroTools: MacroTools, @capture, isexpr
2525

src/PythonCall.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ module PythonCall
33
const VERSION = v"0.9.15"
44
const ROOT_DIR = dirname(@__DIR__)
55

6-
include("utils/_.jl")
7-
include("CPython/_.jl")
8-
include("Py/_.jl")
9-
include("pyconvert/_.jl")
10-
include("pymacro/_.jl")
11-
include("pywrap/_.jl")
12-
include("jlwrap/_.jl")
13-
include("compat/_.jl")
6+
include("Utils/Utils.jl")
7+
include("C/C.jl")
8+
include("GC/GC.jl")
9+
include("Core/Core.jl")
10+
include("Convert/Convert.jl")
11+
include("PyMacro/PyMacro.jl")
12+
include("Wrap/Wrap.jl")
13+
include("JlWrap/JlWrap.jl")
14+
include("Compat/Compat.jl")
1415

1516
# re-export everything
1617
for m in [:_Py, :_pyconvert, :_pymacro, :_pywrap, :_jlwrap, :_compat]

src/Utils/Utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module _Utils
1+
module Utils
22

33
function explode_union(T)
44
@nospecialize T

src/Wrap/Wrap.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
"""
2-
module _pywrap
2+
module PythonCall.Wrap
33
44
Defines Julia wrappers around Python objects, including `PyList`, `PyDict`, `PyArray` and `PyIO`.
55
"""
6-
module _pywrap
6+
module Wrap
77

8-
using .._Py
9-
using .._Py: C, Utils, @autopy, unsafe_pynext, pyisnull, PyNULL, getptr, pydel!, pybytes_asvector, pystr_asUTF8vector, pystr_fromUTF8, incref, decref, pynew, pyisnone, pyistuple, pyisstr
10-
using .._pyconvert: pyconvert, pyconvert_tryconvert, pyconvert_unconverted, pyconvert_isunconverted, pyconvert_return, pyconvert_result
11-
using .._pymacro
8+
using ..Core
9+
using ..Core: C, Utils, @autopy, unsafe_pynext, pyisnull, PyNULL, getptr, pydel!, pybytes_asvector, pystr_asUTF8vector, pystr_fromUTF8, incref, decref, pynew, pyisnone, pyistuple, pyisstr
10+
using ..Convert: pyconvert, pyconvert_tryconvert, pyconvert_unconverted, pyconvert_isunconverted, pyconvert_return, pyconvert_result
11+
using ..PyMacro
1212

1313
using Base: @propagate_inbounds
1414
using Tables: Tables
1515
using UnsafePointers: UnsafePtr
1616

17-
import .._Py: Py, ispy
18-
import .._pyconvert: pyconvert_add_rule, PYCONVERT_PRIORITY_ARRAY, PYCONVERT_PRIORITY_CANONICAL, PYCONVERT_PRIORITY_NORMAL
17+
import ..Core: Py, ispy
18+
import ..Convert: pyconvert_add_rule, PYCONVERT_PRIORITY_ARRAY, PYCONVERT_PRIORITY_CANONICAL, PYCONVERT_PRIORITY_NORMAL
1919

2020
include("PyIterable.jl")
2121
include("PyDict.jl")

0 commit comments

Comments
 (0)