11from MDAnalysis import Universe
22import os
33
4+ import numpy as np
5+
46from ..trajectory_converter import TrajectoryConverter
57from ..data_objects import (
68 AgentData ,
@@ -131,6 +133,10 @@ def _read_pdb_files(self, input_data: NerdssData) -> AgentData:
131133 "bonds" , input_data .display_data
132134 )
133135 next_uid = agent_data .unique_ids .max () + 1
136+
137+ # need our own write-able n_subpoints array
138+ n_subpoints = np .zeros_like (agent_data .n_subpoints )
139+
134140 for timestep in range (n_timesteps ):
135141 n_fibers = len (fiber_positions [timestep ])
136142 n_atoms = int (agent_data .n_agents [timestep ])
@@ -139,7 +145,7 @@ def _read_pdb_files(self, input_data: NerdssData) -> AgentData:
139145 agent_data .subpoints [timestep ][agent_index + n_atoms ] = fiber_positions [
140146 timestep
141147 ][agent_index ]
142- agent_data . n_subpoints [timestep ][agent_index + n_atoms ] = (
148+ n_subpoints [timestep ][agent_index + n_atoms ] = (
143149 VALUES_PER_3D_POINT * 2
144150 )
145151 agent_data .viz_types [timestep ][agent_index + n_atoms ] = VIZ_TYPE .FIBER
@@ -149,6 +155,7 @@ def _read_pdb_files(self, input_data: NerdssData) -> AgentData:
149155 agent_data .types [timestep ].append (bonds_display_data .name )
150156 agent_data .unique_ids [timestep ][agent_index + n_atoms ] = next_uid
151157 next_uid += 1
158+ agent_data .n_subpoints = n_subpoints # overwrite with our own array
152159 return agent_data
153160
154161 def _read (self , input_data : NerdssData ) -> TrajectoryData :
0 commit comments