Skip to content

Commit bddcc5e

Browse files
Merge branch 'dsg_ticket1' into dsg_ticket2
2 parents 0e91599 + fe6d17c commit bddcc5e

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

src/sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ def __init__(self, systems):
303303
(x^2 : y^2)
304304
"""
305305

306-
self._dynamical_systems = _remove_duplicates_of_(systems)
306+
self._dynamical_systems = []
307+
for ds in systems:
308+
if ds not in self._dynamical_systems:
309+
self._dynamical_systems.append(ds)
307310
Parent.__init__(self, category=Semigroups().FinitelyGeneratedAsMagma())
308311

309312
def __call__(self, input):
@@ -915,12 +918,12 @@ def __eq__(self, other):
915918
sage: f == g
916919
Traceback (most recent call last):
917920
...
918-
ValueError: cannot compare dynamical semigroups with at least one generator of degree 1
921+
NotImplementedError: cannot compare dynamical semigroups with at least one generator of degree 1
919922
"""
920923
if isinstance(other, DynamicalSemigroup):
921924
if any(ds.degree() == 1 for ds in self.defining_systems()) or \
922925
any(ds.degree() == 1 for ds in other.defining_systems()):
923-
raise ValueError("cannot compare dynamical semigroups with at least one generator of degree 1")
926+
raise NotImplementedError("cannot compare dynamical semigroups with at least one generator of degree 1")
924927
return all(ds in other.defining_systems() for ds in self.defining_systems()) and \
925928
all(ds in self.defining_systems() for ds in other.defining_systems())
926929
return False
@@ -1146,30 +1149,6 @@ class DynamicalSemigroup_affine_field(DynamicalSemigroup_affine):
11461149
class DynamicalSemigroup_affine_finite_field(DynamicalSemigroup_affine_field):
11471150
pass
11481151

1149-
def _remove_duplicates_of_(list):
1150-
r"""
1151-
Removes duplicate elements from a list.
1152-
1153-
INPUT:
1154-
1155-
- ``list`` -- any list
1156-
1157-
OUTPUT: the original list without duplicate elements
1158-
1159-
EXAMPLES::
1160-
1161-
sage: numbers = [1, 1, 2, 3, 3, 2, 1, 5, 4, 3]
1162-
sage: sage.dynamics.arithmetic_dynamics.dynamical_semigroup._remove_duplicates_of_(numbers)
1163-
[1, 2, 3, 5, 4]
1164-
"""
1165-
seen = []
1166-
1167-
for item in list:
1168-
if item not in seen:
1169-
seen.append(item)
1170-
1171-
return seen
1172-
11731152
def _standardize_domains_of_(systems):
11741153
r"""
11751154
Coerces dynamical systems to the same domain and have the same generators.

0 commit comments

Comments
 (0)