Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions larch/model/controller.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1322,8 +1322,10 @@ cdef class Model5c(AbstractChoiceModel):

from .tree import NestingTree
g = NestingTree(root_id=root_id)
# print(root_id)
if alternative_names is None:
for a in alternative_codes:
# print(a)
g.add_node(a)
else:
for a, name in zip(alternative_codes, alternative_names):
Expand Down
13 changes: 11 additions & 2 deletions larch/numba/data_arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def prepare_data(
if float_dtype is None:
float_dtype = np.float64
log.debug(f"building dataset from datashare coords: {datasource.coords}")
log.debug("dkjfakljdlksajf")
model_dataset = Dataset(
coords=datasource.coords,
)
Expand All @@ -114,11 +115,19 @@ def prepare_data(

from .model import NumbaModel # avoid circular import
if isinstance(request, NumbaModel):
alts = request.graph.elemental_names()
alts = request.graph.elemental_names() # these are wrong, they droop the zero index
alt_dim = model_dataset.dc.ALTID or _ALTID
if model_dataset.dc.ALTID not in model_dataset.coords:
model_dataset.coords[alt_dim] = DataArray(list(alts.keys()), dims=(alt_dim,))
if 'alt_names' not in model_dataset.coords:
if 'alt_names' not in model_dataset.coords: # could we supply this manually?
# display(alts)
# print(alt_dim, len(alts))
# WAS HERE
# print(model_dataset.coords)
# print(alt_dim)
# print(alts)
# print(model_dataset.coords)
print(len(list(alts.values())), alt_dim)
model_dataset.coords['alt_names'] = DataArray(list(alts.values()), dims=(alt_dim,))
request = request.required_data()

Expand Down