Skip to content

Commit

Permalink
Fix stlye
Browse files Browse the repository at this point in the history
  • Loading branch information
vferat committed May 10, 2022
1 parent 2f6ce87 commit cf4dc4a
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 41 deletions.
14 changes: 6 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

# -- Project information -----------------------------------------------------

project = 'ipybuilding'
copyright = '2022, Victor Férat, Jonathan Chambers'
author = 'Victor Férat, Jonathan Chambers'
project = "ipybuilding"
copyright = "2022, Victor Férat, Jonathan Chambers"
author = "Victor Férat, Jonathan Chambers"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -51,7 +51,7 @@
master_doc = "index"

# autodoc
autodoc_typehints = 'none'
autodoc_typehints = "none"

# pygments style
pygments_style = "default"
Expand Down Expand Up @@ -81,9 +81,7 @@

# sphinx_gallery_conf
sphinx_gallery_conf = {
"examples_dirs": os.path.abspath(
os.path.join(curdir, "..", "..", "tutorials")
),
"examples_dirs": os.path.abspath(os.path.join(curdir, "..", "..", "tutorials")),
"gallery_dirs": "auto_tutorials",
"subsection_order": ExplicitOrder(
[
Expand Down Expand Up @@ -122,4 +120,4 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = [os.path.abspath(os.path.join(curdir, "../_static"))]
html_static_path = [os.path.abspath(os.path.join(curdir, "../_static"))]
2 changes: 1 addition & 1 deletion ipybuilding/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__all__ = (
"datasets",
"utils",
)
)
2 changes: 1 addition & 1 deletion ipybuilding/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version number."""

__version__ = "0.1.0.dev"
__version__ = "0.1.0.dev"
2 changes: 1 addition & 1 deletion ipybuilding/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from . import geneva

__all__ = ("geneva",)
__all__ = ("geneva",)
2 changes: 1 addition & 1 deletion ipybuilding/datasets/geneva/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .geneva import load_data

__all__ = ("load_data", )
__all__ = ("load_data",)
24 changes: 11 additions & 13 deletions ipybuilding/datasets/geneva/geneva.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,24 @@ def load_data():
path = config["GENEVA_DATASET_PATH"]
fetcher = pooch.create(
path=path,
base_url=fr"https://drive.switch.ch/index.php/s/OVjDG0Ae03jYlJm/download?path=%2F&files=", # noqa,
base_url=rf"https://drive.switch.ch/index.php/s/OVjDG0Ae03jYlJm/download?path=%2F&files=", # noqa,
version=None,
registry=None,
)
registry = pkr.resource_stream(
"ipybuilding",
os.path.join(
"datasets", "geneva", "data", "registry.txt"
),
os.path.join("datasets", "geneva", "data", "registry.txt"),
)

fetcher.load_registry(registry)
base_filename = 'bases.gpkg'

base_filename = "bases.gpkg"
base_filename = fetcher.fetch(base_filename)
facades_filename = 'facades.gpkg'

facades_filename = "facades.gpkg"
facades_filename = fetcher.fetch(facades_filename)
toits_filename = 'toits.gpkg'

toits_filename = "toits.gpkg"
toits_filename = fetcher.fetch(toits_filename)
return base_filename, facades_filename, toits_filename

return base_filename, facades_filename, toits_filename
15 changes: 11 additions & 4 deletions ipybuilding/datasets/geneva/test/test_geneva.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import os

import geopandas

from ipybuilding.datasets import geneva

start_point = (6.1402,46.208742)
start_point = (6.1402, 46.208742)
delta = 0.001
bbox = (start_point[0] - delta, start_point[1]-delta, start_point[0] + delta, start_point[1]+delta)

bbox = (
start_point[0] - delta,
start_point[1] - delta,
start_point[0] + delta,
start_point[1] + delta,
)


def test_geneva_load_data():
file_paths = geneva.load_data()
for path in file_paths:
assert os.path.isfile(path)
bases = geopandas.read_file(path, bbox=bbox)

2 changes: 1 addition & 1 deletion ipybuilding/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from ._config import get_config

__all__ = ("get_config",)
__all__ = ("get_config",)
9 changes: 3 additions & 6 deletions ipybuilding/utils/_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os


def _get_user_dir():
"""Get user directory."""
if os.name.lower() == "nt":
Expand Down Expand Up @@ -35,11 +36,7 @@ def _get_data_path():
return data_dir


default_config = {
"GENEVA_DATASET_PATH": os.path.join(
_get_data_path(), "GENEVA"
)
}
default_config = {"GENEVA_DATASET_PATH": os.path.join(_get_data_path(), "GENEVA")}


def _save_config(config):
Expand Down Expand Up @@ -78,4 +75,4 @@ def set_config(key, value):
config[key] = value
else:
raise ValueError("Invalid key")
_save_config(config)
_save_config(config)
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@


# Descriptions
short_description = (
"A simple open source Python package"
)
short_description = "A simple open source Python package"
long_description_file = Path(__file__).parent / "README.md"
with open(long_description_file, "r", encoding="utf8") as file:
long_description = file.read()
Expand Down Expand Up @@ -75,4 +73,4 @@ def get_requirements(path):
],
# Include other files
include_package_data=True,
)
)
3 changes: 2 additions & 1 deletion tutorials/geneva/plot_geneva.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
# theses files can esaly be loaded thanks to geopandas:

import geopandas

bases = geopandas.read_file(base_path)
bases
bases

0 comments on commit cf4dc4a

Please sign in to comment.