Skip to content

Commit 0bf9f91

Browse files
authored
Merge pull request #981 from bashtage/docs
STY: Improve style
2 parents ebb7797 + 7cc0e7a commit 0bf9f91

File tree

9 files changed

+13
-23
lines changed

9 files changed

+13
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for the latest changes in master.
3838

3939
Using pandas datareader requires the following packages:
4040

41-
- pandas>=1.0
41+
- pandas>=1.5.3
4242
- lxml
4343
- requests>=2.19.0
4444

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
#
8888
# This is also used if you do content translation via gettext catalogs.
8989
# Usually you set "language" from the command line for these cases.
90-
language = None
90+
language = "en"
9191

9292
# List of patterns, relative to source directory, that match files and
9393
# directories to ignore when looking for source files.
@@ -200,7 +200,7 @@
200200

201201

202202
# Example configuration for intersphinx: refer to the Python standard library.
203-
intersphinx_mapping = {"https://docs.python.org/": None}
203+
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
204204

205205

206206
extlinks = {

pandas_datareader/data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ def DataReader(
491491
elif data_source == "nasdaq":
492492
if name != "symbols":
493493
raise ValueError(
494-
"Only the string 'symbols' is supported for Nasdaq, not {!r}".format(name)
494+
"Only the string 'symbols' is supported for Nasdaq, not {!r}".format(
495+
name
496+
)
495497
)
496498
return get_nasdaq_symbols(retry_count=retry_count, pause=pause)
497499

pandas_datareader/iex/deep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _read_lines(self, out):
8585
if self.sub in fmap:
8686
return getattr(self, fmap[self.sub])(out)
8787
else:
88-
raise f"Invalid service specified: {self.sub}."
88+
raise ValueError(f"Invalid service specified: {self.sub}.")
8989

9090
def _read_system_event(self, out):
9191
# Map the response code to a string output per the API docs.

pandas_datareader/io/sdmx.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ def _get_child(element, key):
167167
elif len(elements) == 0:
168168
raise ValueError(f"Element {element.tag} contains no {key}")
169169
else:
170-
raise ValueError(
171-
f"Element {element.tag} contains multiple {key}"
172-
)
170+
raise ValueError(f"Element {element.tag} contains multiple {key}")
173171

174172

175173
_NAME_EN = f".//{_COMMON}Name[@{_XML}lang='en']"

pandas_datareader/nasdaq_trader.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ def _download_nasdaq_symbols(timeout):
6060
raise RemoteDataError("Missing expected footer. Found %r" % lines[-1])
6161

6262
# Convert Y/N to True/False.
63-
converter_map = {
64-
col: _bool_converter for col, t in _TICKER_DTYPE if t is bool
65-
}
63+
converter_map = {col: _bool_converter for col, t in _TICKER_DTYPE if t is bool}
6664

6765
# For pandas >= 0.20.0, the Python parser issues a warning if
6866
# both a converter and dtype are specified for the same column.

pandas_datareader/quandl.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ def __init__(
5656
chunksize=25,
5757
api_key=None,
5858
):
59-
super().__init__(
60-
symbols, start, end, retry_count, pause, session, chunksize
61-
)
59+
super().__init__(symbols, start, end, retry_count, pause, session, chunksize)
6260
if api_key is None:
6361
api_key = os.getenv("QUANDL_API_KEY")
6462
if not api_key or not isinstance(api_key, str):

pandas_datareader/tests/yahoo/test_yahoo.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ def test_get_quote_comma_name(self):
7171
pytest.xfail(reason=XFAIL_REASON)
7272
assert df["longName"][0] == "Royal Gold, Inc."
7373

74-
@pytest.mark.skip(
75-
"Unreliable test, receive partial components back for dow_jones"
76-
)
74+
@pytest.mark.skip("Unreliable test, receive partial components back for dow_jones")
7775
def test_get_components_dow_jones(self): # pragma: no cover
7876
df = web.get_components_yahoo("^DJI") # Dow Jones
7977
assert isinstance(df, pd.DataFrame)
@@ -87,9 +85,7 @@ def test_get_components_dax(self): # pragma: no cover
8785
assert len(df) == 30
8886
assert df[df.name.str.contains("adidas", case=False)].index == "ADS.DE"
8987

90-
@pytest.mark.skip(
91-
"Unreliable test, receive partial components back for nasdaq_100"
92-
)
88+
@pytest.mark.skip("Unreliable test, receive partial components back for nasdaq_100")
9389
def test_get_components_nasdaq_100(self): # pragma: no cover
9490
# As of 7/12/13, the conditional will
9591
# return false because the link is invalid

pandas_datareader/yahoo/options.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,7 @@ def _parse_url(self, url):
706706
"""
707707
jd = json.loads(self._read_url_as_StringIO(url).read())
708708
if jd is None: # pragma: no cover
709-
raise RemoteDataError(
710-
f"Parsed URL {url!r} is not a valid json object"
711-
)
709+
raise RemoteDataError(f"Parsed URL {url!r} is not a valid json object")
712710
return jd
713711

714712
def _process_data(self, jd):

0 commit comments

Comments
 (0)