Skip to content

Commit

Permalink
rm commviz
Browse files Browse the repository at this point in the history
  • Loading branch information
knaaptime committed Mar 7, 2023
2 parents 286704f + 409b914 commit 7bba7b0
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 398 deletions.
2 changes: 0 additions & 2 deletions codecov.yml
Expand Up @@ -17,8 +17,6 @@ coverage:
- "tools/*"
- "geosnap/tests/*"
- "geosnap/util/*"
- "geosnap/visualize/commviz.py"
- "geosnap/visualize/viz.py"
- "geosnap/io/util.py"
- "geosnap/_version.py"
comment:
Expand Down
1 change: 1 addition & 0 deletions docs/api.rst
Expand Up @@ -196,6 +196,7 @@ Visualize Module
visualize.plot_timeseries
visualize.plot_transition_matrix
visualize.plot_transition_graphs
visualize.plot_violins_by_cluster

.. _util_api:

Expand Down
6 changes: 2 additions & 4 deletions environment.yml
Expand Up @@ -8,7 +8,7 @@ dependencies:
- libpysal
- cenpy
- geopandas >=0.9
- matplotlib
- matplotlib <=3.3.4 # workaround for proplot missing pin upstream
- scikit-learn
- seaborn
- pyarrow >=0.14.1
Expand All @@ -28,6 +28,4 @@ dependencies:
- versioneer
- pyproj >=3
- pandana
- pip
- pip:
- -e . # install local geosnap package in editable mode
- pooch
6 changes: 3 additions & 3 deletions geosnap/io/util.py
@@ -1,5 +1,6 @@
import os
import pathlib
import pooch
from urllib.error import HTTPError
from warnings import warn

Expand Down Expand Up @@ -40,9 +41,8 @@ def get_census_gdb(years=None, geom_level="blockgroup", output_dir="."):
fn = f"{year}_ACS_5YR_{geom_level.capitalize()}.gdb.zip"
out_fn = f"ACS_{year}_5YR_{levels[geom_level].upper()}.gdb.zip"
pth = pathlib.PurePath(output_dir, out_fn)
url = f"ftp://ftp2.census.gov/geo/tiger/TIGER_DP/{year}ACS/{fn}"
download(url, pth)

url = f"https://www2.census.gov/geo/tiger/TIGER_DP/{year}ACS/{fn}"
pooch.retrieve(url, None, progressbar=True, path=pth)

def reformat_acs_vars(col):
"""Convert variable names to the same format used by the Census Detailed Tables API.
Expand Down
9 changes: 8 additions & 1 deletion geosnap/tests/test_plots.py
Expand Up @@ -13,6 +13,7 @@
plot_timeseries,
plot_transition_graphs,
plot_transition_matrix,
plot_violins_by_cluster
)


Expand Down Expand Up @@ -71,9 +72,15 @@ def test_graphs():
def test_animation():
if not os.path.exists('geosnap/tests/images'):
os.mkdir('geosnap/tests/images')
animate_timeseries(dc_df, column='ward', categorical=True, filename='geosnap/tests/images/animation.gif')
animate_timeseries(dc_df, column='ward', categorical=True, filename='geosnap/tests/images/animation.gif', dpi=50)
assert 'animation.gif' in os.listdir('geosnap/tests/images')

def test_violins():
if not os.path.exists('geosnap/tests/images'):
os.mkdir('geosnap/tests/images')
plot_violins_by_cluster(dc_df, cluster_col='ward', columns=columns, savefig='geosnap/tests/images/violins.png', dpi=50)
assert 'violins.png' in os.listdir('geosnap/tests/images')

def test_boundary_silplot():
p = region_mod[1990].plot_boundary_silhouette(dpi=50,)
assert isinstance(p, proplot.gridspec.SubplotGrid
Expand Down
4 changes: 2 additions & 2 deletions geosnap/visualize/__init__.py
@@ -1,4 +1,4 @@
from .seq import *
from .commviz import explore
from .transitions import *
from .mapping import *
from .mapping import *
from .descriptives import *

0 comments on commit 7bba7b0

Please sign in to comment.