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

Bugfixes for composability. #172

Merged
merged 3 commits into from
Nov 22, 2023
Merged

Bugfixes for composability. #172

merged 3 commits into from
Nov 22, 2023

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Nov 22, 2023

Bug 1

At the network level, we had a bug with what initialize() is doing. E.g. the following failed:

cell1 = jx.Cell([branch for _ in range(num_branches)], parents=parents).initialize()
cell1.insert(HHChannel())
cell2 = jx.Cell([branch for _ in range(num_branches)], parents=parents).initialize()

net = jx.Network([cell1, cell2], []).initialize()
_ = jx.integrate(net)

whereas the same code, but with

net = jx.Network([cell1, cell2], [])

worked. The reason was that channels get appended to the current channels upon calling initialize(). In the new version, this appending only happens in the __init__() of Network, thereby fixing the issue.

Bug 2

Also, I found a bug that compartments were assembled into branches in the wrong order.

comp1 = jx.Compartment()
comp1.insert(HHChannel())
comp2 = jx.Compartment()
branch1 = jx.Branch([comp1, comp2])

comp = jx.Compartment()
branch2 = jx.Branch(comp, nseg=2)
branch2.comp(0.0).insert(HHChannel())  # Previously needed 1.0 indexing!

@michaeldeistler michaeldeistler changed the title Init Bugfixes for composability. Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant