Skip to content

Commit

Permalink
mega rerun everything
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpedigo committed May 19, 2022
1 parent 3dad199 commit 7955195
Show file tree
Hide file tree
Showing 30 changed files with 2,658 additions and 2,631 deletions.
163 changes: 74 additions & 89 deletions docs/connectomes.ipynb

Large diffs are not rendered by default.

57 changes: 28 additions & 29 deletions docs/explain.ipynb

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions docs/process_c_elegans.ipynb

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions docs/process_maggot.ipynb

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions docs/process_p_pacificus.ipynb

Large diffs are not rendered by default.

86 changes: 42 additions & 44 deletions docs/simulations.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion overleaf
Submodule overleaf updated from d5e040 to 8e75d4
2 changes: 1 addition & 1 deletion pkg/pkg/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .load_data import DATA_PATH, DATA_VERSION, load_split_connectome
from .load_data import DATA_PATH, load_split_connectome
18 changes: 0 additions & 18 deletions pkg/pkg/data/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,10 @@
import pandas as pd


version_loc = Path(__file__).parent / "version.txt"
with open(version_loc) as f:
version = f.readline()

processed_loc = Path(__file__).parent / "processed_version.txt"
with open(processed_loc) as f:
processed_version = f.readline()

DATA_VERSION = version
DATA_PATH = Path(__file__).parent.parent.parent.parent # don't judge me judge judy
DATA_PATH = DATA_PATH / "data"


def _get_folder(path, version):
if path is None:
path = DATA_PATH
if version is None:
version = DATA_VERSION
folder = path / version
return folder


def load_split_connectome(dataset, weights=True):
dir = DATA_PATH / "processed_split"
if weights:
Expand Down
4 changes: 3 additions & 1 deletion pkg/pkg/match/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# Type aliases
PaddingType = Literal["adopted", "naive"]
InitMethodType = Literal["barycenter", "rand", "randomized"]
RandomStateType = Optional[Union[int, np.random.RandomState, np.random.Generator]]
RandomStateType = Optional[
Union[int, np.random.RandomState, np.random.Generator, np.integer]
]
ArrayLikeOfIndexes = Union[List[int], np.ndarray]
MultilayerAdjacency = Union[List[AdjacencyMatrix], AdjacencyMatrix, np.ndarray]
Scalar = Union[int, float, np.integer]
Expand Down
1 change: 1 addition & 0 deletions pkg/pkg/plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
get_text_width,
get_texts_points,
make_sequential_colormap,
merge_axes,
multicolor_text,
nice_text,
rainbowarrow,
Expand Down
24 changes: 24 additions & 0 deletions pkg/pkg/plot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,27 @@ def rainbowarrow(ax, start, end, cmap="viridis", n=50, lw=3):
tri = mpl.path.Path(tricoords2, closed=True)
ax.scatter(end[0], end[1], c=1, s=(2 * lw) ** 2, marker=tri, cmap=cmap, vmin=0)
ax.autoscale_view()


def _get_slice(items, n_items):
if items is None:
return slice(0, n_items)
elif type(items) == int:
return items
elif len(items) == 1:
return items[0]
else:
return slice(items[0], items[1])


def merge_axes(fig, axs, rows=None, cols=None):
# TODO I could't figure out a safer way to do this without eval
# seems like gridspec.__getitem__ only wants numpy indices in the slicing form
# REF: https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_and_subplots.html
row_slice = _get_slice(rows, axs.shape[0])
col_slice = _get_slice(cols, axs.shape[1])
gs = axs.flat[0].get_gridspec()
for ax in axs[row_slice, col_slice].ravel():
ax.remove()
ax = fig.add_subplot(gs[row_slice, col_slice])
return ax
1 change: 0 additions & 1 deletion pkg/pkg/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .toy import get_toy_palette, sample_toy_networks
from .utils import set_warnings
from .wrangle import (
create_node_data,
ensure_connected,
Expand Down
53 changes: 44 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ graspologic = "^1.0.0"
jupyter-client = "6.1.12" # https://github.com/jupyter/jupyter_client/issues/637
svgutils = "^0.3.4"
python-catmaid = "^2.1.1"
jupytext = "^1.13.8"

[tool.poetry.dev-dependencies]
black = "^22.3.0"
Expand Down
Binary file modified results/figs/connectomes/match_accuracy_comparison.pdf
Binary file not shown.
Binary file modified results/figs/connectomes/match_accuracy_comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7955195

Please sign in to comment.