Skip to content

Commit

Permalink
Fix description length when printing.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsrey committed Dec 20, 2020
1 parent 231d150 commit b828b30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion libpysal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.3.0"
__version__ = "4.3.1"

# __version__ has to be define in the first line

Expand Down
24 changes: 9 additions & 15 deletions libpysal/examples/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ def get_data_home():
Alternatively, it can be set by the 'PYSALDATA' environment variable or programmatically
by giving an explicit folder path. The ``'~'`` symbol is expanded to the user home
folder If the folder does not already exist, it is automatically created.
Returns
-------
data_home : str
The system path where the data is/will be stored.
"""

data_home = environ.get("PYSALDATA", join("~", PYSALDATA))
Expand All @@ -45,22 +45,22 @@ def get_data_home():

def get_list_of_files(dir_name):
"""Create a list of files and sub-directories in ``dir_name``.
Parameters
----------
dir_name : str
The path to the directory or examples.
Returns
-------
all_files : list
All file and directory paths.
Raises
------
FileNotFoundError
If the file or directory is not found.
"""

# names in the given directory
Expand All @@ -82,7 +82,6 @@ def get_list_of_files(dir_name):
return all_files



def type_of_script() -> str:
"""Helper function to determine run context."""

Expand Down Expand Up @@ -113,7 +112,7 @@ class Example:
The URL to download the dataset.
explain_url : str
The URL to the dataset's READEME file.
Attributes
----------
root : str
Expand All @@ -122,7 +121,7 @@ class Example:
``True`` if the example is installed, otherwise ``False``.
zipfile : zipfile.ZipFile
The archived dataset.
"""

def __init__(self, name, description, n, k, download_url, explain_url):
Expand Down Expand Up @@ -161,7 +160,6 @@ def downloaded(self) -> bool:
return True
return False


def explain(self) -> None:
"""Provide a description of the example."""

Expand Down Expand Up @@ -199,7 +197,6 @@ def get_file_list(self) -> Union[list, None]:
return get_list_of_files(path)
return None


def json_dict(self) -> dict:
"""Container for example meta data."""
meta = {}
Expand Down Expand Up @@ -227,7 +224,6 @@ def add_examples(self, examples):
"""Add examples to the set of datasets available."""
self.datasets.update(examples)


def explain(self, example_name) -> str:
if example_name in self.datasets:
return self.datasets[example_name].explain()
Expand All @@ -248,8 +244,7 @@ def available(self):
data=rows, columns=["Name", "Description", "Installed"]
)
datasets.style.set_properties(subset=["text"], **{"width": "300px"})
print(datasets.to_string())

print(datasets.to_string(max_colwidth=60))

def load(self, example_name: str) -> Example:
"""Load example dataset, download if not locally available."""
Expand Down Expand Up @@ -278,7 +273,6 @@ def download_remotes(self):
except:
print("Example not downloaded: {}".format(name))


def get_installed_names(self) -> list:
"""Return names of all currently installed datasets."""
ds = self.datasets
Expand Down

0 comments on commit b828b30

Please sign in to comment.