Skip to content

Commit

Permalink
Make template copyable
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasZahradnik committed Nov 23, 2023
1 parent 7d06df9 commit a51d6fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions neuralogic/core/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,14 @@ def __setitem__(self, key, value):
if isinstance(value, (Iterable, Module)):
raise NotImplementedError
self.template[key] = value

def __copy__(self) -> "Template":
temp = Template()

temp.template_file = self.template_file
temp.template = self.template

return temp

def clone(self) -> "Template":
return self.__copy__()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target-version = ['py38']
target-version = ['py39']

[tool.mypy]
ignore_missing_imports = true

0 comments on commit a51d6fd

Please sign in to comment.