Skip to content

Commit 9bbb5f0

Browse files
ShaharNavehtopper-123
authored andcommitted
DOC: Improved pandas/compact/__init__.py (#29507)
1 parent 6498bc1 commit 9bbb5f0

File tree

1 file changed

+59
-5
lines changed

1 file changed

+59
-5
lines changed

pandas/compat/__init__.py

+59-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
def set_function_name(f, name, cls):
3030
"""
31-
Bind the name/qualname attributes of the function
31+
Bind the name/qualname attributes of the function.
3232
"""
3333
f.__name__ = name
3434
f.__qualname__ = "{klass}.{name}".format(klass=cls.__name__, name=name)
@@ -38,28 +38,72 @@ def set_function_name(f, name, cls):
3838

3939
# https://github.com/pandas-dev/pandas/pull/9123
4040
def is_platform_little_endian():
41-
""" am I little endian """
41+
"""
42+
Checking if the running platform is little endian.
43+
44+
Returns
45+
-------
46+
bool
47+
True if the running platform is little endian.
48+
"""
4249
return sys.byteorder == "little"
4350

4451

4552
def is_platform_windows():
53+
"""
54+
Checking if the running platform is windows.
55+
56+
Returns
57+
-------
58+
bool
59+
True if the running platform is windows.
60+
"""
4661
return sys.platform == "win32" or sys.platform == "cygwin"
4762

4863

4964
def is_platform_linux():
65+
"""
66+
Checking if the running platform is linux.
67+
68+
Returns
69+
-------
70+
bool
71+
True if the running platform is linux.
72+
"""
5073
return sys.platform == "linux2"
5174

5275

5376
def is_platform_mac():
77+
"""
78+
Checking if the running platform is mac.
79+
80+
Returns
81+
-------
82+
bool
83+
True if the running platform is mac.
84+
"""
5485
return sys.platform == "darwin"
5586

5687

5788
def is_platform_32bit():
89+
"""
90+
Checking if the running platform is 32-bit.
91+
92+
Returns
93+
-------
94+
bool
95+
True if the running platform is 32-bit.
96+
"""
5897
return struct.calcsize("P") * 8 < 64
5998

6099

61100
def _import_lzma():
62-
"""Attempts to import lzma, warning the user when lzma is not available.
101+
"""
102+
Attempts to import the lzma module.
103+
104+
Warns
105+
-----
106+
When the lzma module is not available.
63107
"""
64108
try:
65109
import lzma
@@ -75,8 +119,18 @@ def _import_lzma():
75119

76120

77121
def _get_lzma_file(lzma):
78-
"""Returns the lzma method LZMAFile when the module was correctly imported.
79-
Otherwise, raises a RuntimeError.
122+
"""
123+
Attempting to get the lzma.LZMAFile class.
124+
125+
Returns
126+
-------
127+
class
128+
The lzma.LZMAFile class.
129+
130+
Raises
131+
------
132+
RuntimeError
133+
If the module lzma was not imported correctly, or didn't exist.
80134
"""
81135
if lzma is None:
82136
raise RuntimeError(

0 commit comments

Comments
 (0)