AttributeError: module 'collections' has no attribute 'Sequence' when indexing orbital_parameters in Python 3.10
Stack trace reported from user:
AttributeError Traceback (most recent call last)
Input In [3], in <module>
1 # Incident angle
2 incm = 31
----> 3 swth_bst = sargeo.SingleSwathBistatic(par_file=parfile, dau=along_track_separation)
4 # Observation geometry calculated from orbit
5 obsgeo = ObsGeo.from_swath_geo(incm, swth_bst, ascending=True)
File /mnt/env/py31env/lib/python3.10/site-packages/drama/geo/swath_geo.py:681, in SingleSwathBistatic.__init__(self, orb_type, look, ext_source, par_file, inc_angle, dau, n_orbits, verbosity)
679 Angle = namedtuple("Angle", ["near", "far"])
680 self.look_angles = Angle(la_near, la_far)
--> 681 self.master_orbit = drorb.SingleOrbit(conffile=par_file)
682 self.slave_orbit = drorb.SingleOrbit(
683 conffile=par_file,
684 aei=self.master_orbit.aei,
685 companion_delay=self.orb_delay,
686 )
687 self.n_current_orbit = 0
File /mnt/env/py31env/lib/python3.10/site-packages/drama/orbits/keplerian.py:484, in SingleOrbit.__init__(self, conffile, conftuple, aei, orb_type, perigee_drift, comp_dasc_node, companion_delay)
482 self.epoch = self.conf.orbit.epoch
483 self.mean_anomaly_0 = np.deg2rad(self.conf.orbit.mean_anomaly) # in degrees
--> 484 self.__calc_orbit()
File /mnt/env/py31env/lib/python3.10/site-packages/drama/orbits/keplerian.py:595, in SingleOrbit.__calc_orbit(self)
591 self.mean_anomaly_0 = (
592 self.mean_anomaly_0 + self.companion_delay / self.t_orb * 2 * np.pi
593 )
594 self.asc_node_c = self.asc_node
--> 595 keporb = KeplerianOrbit(
596 e,
597 a,
598 i,
599 omega,
600 asc_node=self.asc_node,
601 mean_anomaly=self.mean_anomaly_0,
602 epoch=dateutil.parser.parse(self.conf.orbit.epoch),
603 interval=timeduration,
604 timestep=self.timestep,
605 starttime=self.starttime,
606 perigee_drift=self.perigee_drift,
607 )
608 self.keporb = keporb
609 if self.companion:
File /mnt/env/py31env/lib/python3.10/site-packages/drama/orbits/keplerian.py:131, in KeplerianOrbit.__init__(self, e, a, i, omega, asc_node, mean_anomaly, epoch, accuracy, r_planet, gm_planet, interval, timestep, starttime, offset_time, adjust_ascending_node, verbose, perigee_drift)
129 self.velocity_vec = None
130 self.__init_done = True
--> 131 self.__calc_orb()
File /mnt/env/py31env/lib/python3.10/site-packages/drama/orbits/keplerian.py:384, in KeplerianOrbit.__calc_orb(self, verbose)
382 lon_arr = lon_arr[offset:]
383 lat_arr = lat_arr[offset:]
--> 384 orbital_parameters = orbital_parameters[offset:]
385 self.timevec = timevec
386 self.reci = reci
File /mnt/env/py31env/lib/python3.10/site-packages/drama/orbits/two_body.py:35, in OrbitParameters.__getitem__(self, key)
33 op_vars = vars(op)
34 for k in op_vars:
---> 35 if isinstance(op_vars[k], (collections.Sequence, np.ndarray)):
36 op_vars[k] = op_vars[k][key]
37 return op