Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tbgl
tools
mrdna
Commits
5baef287
Commit
5baef287
authored
Jan 03, 2019
by
cmaffeo2
Browse files
Made changes that should improve handling of connections within a segment
parent
dbc26c65
Changes
1
Hide whitespace changes
Inline
Side-by-side
mrdna/segmentmodel.py
View file @
5baef287
...
...
@@ -111,7 +111,8 @@ class Connection():
def
delete
(
self
):
self
.
A
.
container
.
connections
.
remove
(
self
)
self
.
B
.
container
.
connections
.
remove
(
self
)
if
self
.
B
.
container
is
not
self
.
A
.
container
:
self
.
B
.
container
.
connections
.
remove
(
self
)
self
.
A
.
connection
=
None
self
.
B
.
connection
=
None
...
...
@@ -188,7 +189,8 @@ class ConnectableElement():
A
.
connection
=
B
.
connection
=
connection
self
.
connections
.
append
(
connection
)
other
.
connections
.
append
(
connection
)
if
other
is
not
self
:
other
.
connections
.
append
(
connection
)
l
=
A
.
container
.
locations
if
A
not
in
l
:
l
.
append
(
A
)
l
=
B
.
container
.
locations
...
...
@@ -532,9 +534,11 @@ class Segment(ConnectableElement, Group):
def
clear_all
(
self
):
Group
.
clear_all
(
self
)
# TODO: use super?
self
.
beads
=
[]
for
c
,
loc
,
other
in
self
.
get_connections_and_locations
():
loc
.
particle
=
None
other
.
particle
=
None
# for c,loc,other in self.get_connections_and_locations():
# loc.particle = None
# other.particle = None
for
l
in
self
.
locations
:
l
.
particle
=
None
def
contour_to_nt_pos
(
self
,
contour_pos
,
round_nt
=
False
):
nt
=
contour_pos
*
(
self
.
num_nt
)
-
0.5
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment