Skip to content

ENH: Expose symlog scaling in plotting API #24871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7e461a1
remove \n from docstring
charlesdong1991 Dec 3, 2018
1314059
fix conflicts
charlesdong1991 Jan 19, 2019
db4440d
add sym option for logx logy loglog and tests
charlesdong1991 Jan 21, 2019
a49be7f
BUG: DataFrame respects dtype with masked recarray (#24874)
mroeschke Jan 22, 2019
853cd70
REF/CLN: Move private method (#24875)
mroeschke Jan 22, 2019
6155ffd
changes based on reviews
charlesdong1991 Jan 22, 2019
597f9f3
BUG : ValueError in case on NaN value in groupby columns (#24850)
cgangwar11 Jan 22, 2019
c588437
BUG: fix floating precision formatting in presence of inf (#24863)
glemaitre Jan 23, 2019
8972ddf
DOC: Creating top-level user guide section, and moving pages inside (…
datapythonista Jan 23, 2019
14eac28
DOC: Creating top-level development section, and moving pages inside …
datapythonista Jan 23, 2019
4b937ff
DOC: Creating top-level getting started section, and moving pages ins…
datapythonista Jan 23, 2019
6a745d8
DOC: Implementing redirect system, and adding user_guide redirects (#…
datapythonista Jan 23, 2019
2fa0835
DOC: fixups (#24888)
TomAugspurger Jan 23, 2019
94d989e
CLN: fix typo in ctors.SeriesDtypesConstructors setup (#24894)
qwhelan Jan 24, 2019
0c319f5
DOC: No clean in sphinx_build (#24902)
TomAugspurger Jan 24, 2019
17ad791
BUG (output formatting): use fixed with for truncation column instead…
jorisvandenbossche Jan 24, 2019
e2c0b12
DOC: also redirect old whatsnew url (#24906)
jorisvandenbossche Jan 24, 2019
0a4665a
Revert BUG-24212 fix usage of Index.take in pd.merge (#24904)
TomAugspurger Jan 24, 2019
fa12b9e
DOC: Add experimental note to DatetimeArray and TimedeltaArray (#24882)
TomAugspurger Jan 24, 2019
5761e35
Disable M8 in nanops (#24907)
TomAugspurger Jan 24, 2019
539c54f
CLN: fix typo in asv benchmark of non_unique_sorted, which was not so…
qwhelan Jan 25, 2019
f971b11
API/VIS: remove misc plotting methods from plot accessor (revert #238…
jorisvandenbossche Jan 25, 2019
bb86a9d
DOC: some 0.24.0 whatsnew clean-up (#24911)
jorisvandenbossche Jan 25, 2019
013ae3d
DOC: Final reorganization of documentation pages (#24890)
datapythonista Jan 25, 2019
85982ed
DOC: Adding redirects to API moved pages (#24909)
datapythonista Jan 25, 2019
0bc2d3e
DOC: Making home page links more compact and clearer (#24928)
datapythonista Jan 25, 2019
14b68ea
DOC: 0.24 release date (#24930)
TomAugspurger Jan 25, 2019
8a8a083
DOC: Adding version to the whatsnew section in the home page (#24929)
datapythonista Jan 25, 2019
c8aae35
API: Remove IntervalArray from top-level (#24926)
TomAugspurger Jan 25, 2019
83eb242
RLS: 0.24.0
TomAugspurger Jan 25, 2019
0c4113f
DEV: Start 0.25 cycle
TomAugspurger Jan 25, 2019
d2fa4b4
DOC: State that we support scalars in to_numeric (#24944)
gfyoung Jan 26, 2019
2626215
DOC: Minor what's new fix (#24933)
rth Jan 26, 2019
c1cad5d
TST: GH#23922 Add missing match params to pytest.raises (#24937)
mike-cramblett Jan 26, 2019
dd7afa0
Add tests for NaT when performing dt.to_period (#24921)
alexander-ponomaroff Jan 26, 2019
b641963
DOC: switch headline whatsnew to 0.25 (#24941)
h-vetinari Jan 26, 2019
41166c6
BUG-24212 fix regression in #24897 (#24916)
JustinZhengBC Jan 26, 2019
69a2c54
CLN: reduce overhead in setup for categoricals benchmarks in asv (#24…
qwhelan Jan 26, 2019
9541540
Excel Reader Refactor - Base Class Introduction (#24829)
WillAyd Jan 26, 2019
37a224d
TST/REF: Add pytest idiom to test_numeric.py (#24946)
gfyoung Jan 26, 2019
602eda4
BLD: silence npy_no_deprecated warnings with numpy>=1.16.0 (#24864)
jbrockmendel Jan 26, 2019
95f8dca
CLN: Refactor cython to use memory views (#24932)
noamher Jan 26, 2019
2b16e2e
DOC: Clean sort_values and sort_index docstrings (#24843)
Jan 27, 2019
22b2795
changes based on reviews
charlesdong1991 Jan 27, 2019
f724113
add sym option for logx logy loglog and tests
charlesdong1991 Jan 21, 2019
aab92ae
changes based on reviews
charlesdong1991 Jan 22, 2019
c04601a
changes based on reviews
charlesdong1991 Jan 27, 2019
41b08c8
add whatsnew
charlesdong1991 Jan 27, 2019
7bc480a
Merge branch 'issue_24867' of github.com:charlesdong1991/pandas into …
charlesdong1991 Jan 27, 2019
0bd227f
all my changes in a signle change
charlesdong1991 Jan 27, 2019
36c8eb4
Merge branch 'issue_24867' of github.com:charlesdong1991/pandas into …
charlesdong1991 Jan 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ asv_bench/pandas/
# Documentation generated files #
#################################
doc/source/generated
doc/source/api/generated
doc/source/user_guide/styled.xlsx
doc/source/reference/api
doc/source/_static
doc/source/vbench
doc/source/vbench.rst
doc/source/index.rst
doc/build/html/index.html
# Windows specific leftover:
doc/tmp.sv
doc/source/styled.xlsx
env/
doc/source/savefig/
19 changes: 13 additions & 6 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,19 @@ class CategoricalSlicing(object):

def setup(self, index):
N = 10**6
values = list('a' * N + 'b' * N + 'c' * N)
indices = {
'monotonic_incr': pd.Categorical(values),
'monotonic_decr': pd.Categorical(reversed(values)),
'non_monotonic': pd.Categorical(list('abc' * N))}
self.data = indices[index]
categories = ['a', 'b', 'c']
values = [0] * N + [1] * N + [2] * N
if index == 'monotonic_incr':
self.data = pd.Categorical.from_codes(values,
categories=categories)
elif index == 'monotonic_decr':
self.data = pd.Categorical.from_codes(list(reversed(values)),
categories=categories)
elif index == 'non_monotonic':
self.data = pd.Categorical.from_codes([0, 1, 2] * N,
categories=categories)
else:
raise ValueError('Invalid index param: {}'.format(index))

self.scalar = 10000
self.list = list(range(10000))
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SeriesDtypesConstructors(object):

def setup(self):
N = 10**4
self.arr = np.random.randn(N, N)
self.arr = np.random.randn(N)
self.arr_str = np.array(['foo', 'bar', 'baz'], dtype=object)
self.s = Series([Timestamp('20110101'), Timestamp('20120101'),
Timestamp('20130101')] * N * 10)
Expand Down
3 changes: 2 additions & 1 deletion asv_bench/benchmarks/index_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def setup(self, dtype):
self.sorted = self.idx.sort_values()
half = N // 2
self.non_unique = self.idx[:half].append(self.idx[:half])
self.non_unique_sorted = self.sorted[:half].append(self.sorted[:half])
self.non_unique_sorted = (self.sorted[:half].append(self.sorted[:half])
.sort_values())
self.key = self.sorted[N // 4]

def time_boolean_array(self, dtype):
Expand Down
86 changes: 80 additions & 6 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
import sys
import os
import shutil
import csv
import subprocess
import argparse
import webbrowser
import docutils
import docutils.parsers.rst


DOC_PATH = os.path.dirname(os.path.abspath(__file__))
SOURCE_PATH = os.path.join(DOC_PATH, 'source')
BUILD_PATH = os.path.join(DOC_PATH, 'build')
BUILD_DIRS = ['doctrees', 'html', 'latex', 'plots', '_static', '_templates']
REDIRECTS_FILE = os.path.join(DOC_PATH, 'redirects.csv')


class DocBuilder:
Expand All @@ -50,7 +53,7 @@ def __init__(self, num_jobs=0, include_api=True, single_doc=None,
if single_doc and single_doc.endswith('.rst'):
self.single_doc_html = os.path.splitext(single_doc)[0] + '.html'
elif single_doc:
self.single_doc_html = 'api/generated/pandas.{}.html'.format(
self.single_doc_html = 'reference/api/pandas.{}.html'.format(
single_doc)

def _process_single_doc(self, single_doc):
Expand All @@ -60,7 +63,7 @@ def _process_single_doc(self, single_doc):

For example, categorial.rst or pandas.DataFrame.head. For the latter,
return the corresponding file path
(e.g. generated/pandas.DataFrame.head.rst).
(e.g. reference/api/pandas.DataFrame.head.rst).
"""
base_name, extension = os.path.splitext(single_doc)
if extension in ('.rst', '.ipynb'):
Expand Down Expand Up @@ -118,8 +121,6 @@ def _sphinx_build(self, kind):
raise ValueError('kind must be html or latex, '
'not {}'.format(kind))

self.clean()

cmd = ['sphinx-build', '-b', kind]
if self.num_jobs:
cmd += ['-j', str(self.num_jobs)]
Expand All @@ -139,6 +140,77 @@ def _open_browser(self, single_doc_html):
single_doc_html)
webbrowser.open(url, new=2)

def _get_page_title(self, page):
"""
Open the rst file `page` and extract its title.
"""
fname = os.path.join(SOURCE_PATH, '{}.rst'.format(page))
option_parser = docutils.frontend.OptionParser(
components=(docutils.parsers.rst.Parser,))
doc = docutils.utils.new_document(
'<doc>',
option_parser.get_default_values())
with open(fname) as f:
data = f.read()

parser = docutils.parsers.rst.Parser()
# do not generate any warning when parsing the rst
with open(os.devnull, 'a') as f:
doc.reporter.stream = f
parser.parse(data, doc)

section = next(node for node in doc.children
if isinstance(node, docutils.nodes.section))
title = next(node for node in section.children
if isinstance(node, docutils.nodes.title))

return title.astext()

def _add_redirects(self):
"""
Create in the build directory an html file with a redirect,
for every row in REDIRECTS_FILE.
"""
html = '''
<html>
<head>
<meta http-equiv="refresh" content="0;URL={url}"/>
</head>
<body>
<p>
The page has been moved to <a href="{url}">{title}</a>
</p>
</body>
<html>
'''
with open(REDIRECTS_FILE) as mapping_fd:
reader = csv.reader(mapping_fd)
for row in reader:
if not row or row[0].strip().startswith('#'):
continue

path = os.path.join(BUILD_PATH,
'html',
*row[0].split('/')) + '.html'

try:
title = self._get_page_title(row[1])
except Exception:
# the file can be an ipynb and not an rst, or docutils
# may not be able to read the rst because it has some
# sphinx specific stuff
title = 'this page'

if os.path.exists(path):
raise RuntimeError((
'Redirection would overwrite an existing file: '
'{}').format(path))

with open(path, 'w') as moved_page_fd:
moved_page_fd.write(
html.format(url='{}.html'.format(row[1]),
title=title))

def html(self):
"""
Build HTML documentation.
Expand All @@ -150,6 +222,8 @@ def html(self):

if self.single_doc_html is not None:
self._open_browser(self.single_doc_html)
else:
self._add_redirects()
return ret_code

def latex(self, force=False):
Expand Down Expand Up @@ -184,7 +258,7 @@ def clean():
Clean documentation generated files.
"""
shutil.rmtree(BUILD_PATH, ignore_errors=True)
shutil.rmtree(os.path.join(SOURCE_PATH, 'api', 'generated'),
shutil.rmtree(os.path.join(SOURCE_PATH, 'reference', 'api'),
ignore_errors=True)

def zip_html(self):
Expand Down
Loading