misc fixes
This commit is contained in:
parent
d079b44883
commit
cca6b90830
@ -345,6 +345,7 @@ class FlatBuilder(PortList):
|
|||||||
other_copy.mirror2d(mirrored)
|
other_copy.mirror2d(mirrored)
|
||||||
other_copy.rotate_around(pivot, rotation)
|
other_copy.rotate_around(pivot, rotation)
|
||||||
other_copy.translate_elements(offset)
|
other_copy.translate_elements(offset)
|
||||||
|
other_copy.ports.clear()
|
||||||
self.pattern.append(other_copy)
|
self.pattern.append(other_copy)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
|
|||||||
Returns:
|
Returns:
|
||||||
(name, pattern) tuple
|
(name, pattern) tuple
|
||||||
"""
|
"""
|
||||||
from .pattern import Pattern
|
from .pattern import NamedPattern
|
||||||
#name = self.get_name(base_name)
|
#name = self.get_name(base_name)
|
||||||
npat = NamedPattern(name)
|
npat = NamedPattern(name)
|
||||||
self[name] = npat
|
self[name] = npat
|
||||||
@ -550,7 +550,7 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
|
|||||||
if internal_conflicts:
|
if internal_conflicts:
|
||||||
raise LibraryError('Renamed patterns conflict with un-renamed names in `other`' + pformat(internal_conflicts))
|
raise LibraryError('Renamed patterns conflict with un-renamed names in `other`' + pformat(internal_conflicts))
|
||||||
|
|
||||||
conflicts = set(self.keys()) & renamed
|
conflicts = set(self.keys()) & set(rename_map.values())
|
||||||
if conflicts:
|
if conflicts:
|
||||||
raise LibraryError('Unresolved duplicate keys encountered in library merge: ' + pformat(conflicts))
|
raise LibraryError('Unresolved duplicate keys encountered in library merge: ' + pformat(conflicts))
|
||||||
|
|
||||||
@ -559,6 +559,8 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
|
|||||||
|
|
||||||
for old_name, new_name in rename_map.items():
|
for old_name, new_name in rename_map.items():
|
||||||
temp.rename(old_name, new_name, move_references=True)
|
temp.rename(old_name, new_name, move_references=True)
|
||||||
|
for key in temp.keys():
|
||||||
|
self._merge(key, temp, key)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for key in other.keys():
|
for key in other.keys():
|
||||||
@ -592,6 +594,7 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
|
|||||||
name = tree.top
|
name = tree.top
|
||||||
else:
|
else:
|
||||||
tree.library.rename(tree.top, name, move_references=True)
|
tree.library.rename(tree.top, name, move_references=True)
|
||||||
|
tree.top = name
|
||||||
|
|
||||||
self.add(tree.library, rename_theirs=rename_theirs)
|
self.add(tree.library, rename_theirs=rename_theirs)
|
||||||
return name
|
return name
|
||||||
|
@ -83,7 +83,6 @@ def data_to_ports(
|
|||||||
Returns:
|
Returns:
|
||||||
The updated `pattern`. Port labels are not removed.
|
The updated `pattern`. Port labels are not removed.
|
||||||
"""
|
"""
|
||||||
print(f'TODO pat2dev {name}')
|
|
||||||
if pattern.ports:
|
if pattern.ports:
|
||||||
logger.warning(f'Pattern {name if name else pattern} already had ports, skipping data_to_ports')
|
logger.warning(f'Pattern {name if name else pattern} already had ports, skipping data_to_ports')
|
||||||
return pattern
|
return pattern
|
||||||
|
Loading…
Reference in New Issue
Block a user