From 8402cc01114db2cf87fad7aa388c449818dc2ff4 Mon Sep 17 00:00:00 2001 From: Tom Gillespie Date: Fri, 28 Aug 2020 01:02:52 -0700 Subject: [PATCH] neurondm update model relative_path calls to handle no repo case --- neurondm/neurondm/models/allen_cell_types.py | 4 +++- neurondm/neurondm/models/bolew.py | 3 ++- neurondm/neurondm/models/keast2020.py | 2 +- neurondm/neurondm/models/ma2015.py | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/neurondm/neurondm/models/allen_cell_types.py b/neurondm/neurondm/models/allen_cell_types.py index 72551390..c2647e64 100755 --- a/neurondm/neurondm/models/allen_cell_types.py +++ b/neurondm/neurondm/models/allen_cell_types.py @@ -240,7 +240,9 @@ def make_config(self): prefixes=self.prefixes, branch=self.branch, sources=tuple(), # TODO insert the link to the query... - source_file=relative_path(__file__)) + source_file=relative_path( + __file__, + no_wd_value=__file__)) def build_neurons(self): instances = [] diff --git a/neurondm/neurondm/models/bolew.py b/neurondm/neurondm/models/bolew.py index 20d1dc70..e8b03ebe 100755 --- a/neurondm/neurondm/models/bolew.py +++ b/neurondm/neurondm/models/bolew.py @@ -72,7 +72,8 @@ class BolserLewisNeuron(NeuronEBM): def main(): a = APIN() - config = Config('bolser-lewis', source_file=relative_path(__file__)) + config = Config('bolser-lewis', + source_file=relative_path(__file__, no_wd_value=__file__)) bags = list(a.bags) for label, bag in bags: BolserLewisNeuron(*bag, label=label, override=True) diff --git a/neurondm/neurondm/models/keast2020.py b/neurondm/neurondm/models/keast2020.py index 0d9dd16e..c782a764 100755 --- a/neurondm/neurondm/models/keast2020.py +++ b/neurondm/neurondm/models/keast2020.py @@ -147,7 +147,7 @@ def syn_chain_axons_in(syn_index, soma_index): def main(): from pyontutils.utils import relative_path config = Config('keast-2020', - source_file=relative_path(__file__),) + source_file=relative_path(__file__, no_wd_value=__file__)) with Keast2020: needs_keast_namespace() diff --git a/neurondm/neurondm/models/ma2015.py b/neurondm/neurondm/models/ma2015.py index f0655e04..3f6643fe 100755 --- a/neurondm/neurondm/models/ma2015.py +++ b/neurondm/neurondm/models/ma2015.py @@ -164,10 +164,11 @@ def _end(self): def main(): import csv from neurondm.core import auth - with open((auth.get_path('resources') / '26451489 table 1.csv').as_posix(), 'rt') as f: + with open(auth.get_path('resources') / '26451489 table 1.csv', 'rt') as f: rows = [list(r) for r in zip(*csv.reader(f))] - config = Config('markram-2015', source_file=relative_path(__file__)) + config = Config('markram-2015', + source_file=relative_path(__file__, no_wd_value=__file__)) table1(rows) return config,