Skip to content

Commit

Permalink
Merge branch 'master' into newCapModel3
Browse files Browse the repository at this point in the history
  • Loading branch information
MSK61 committed Nov 13, 2024
2 parents f3f5379 + 01046f2 commit 9b0ccff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
15 changes: 5 additions & 10 deletions examples/unified memory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"#\n",
"# author: Mohammed El-Afifi (ME)\n",
"#\n",
"# environment: Visual Studio Code 1.92.0, python 3.12.4, Fedora release\n",
"# 40 (Forty)\n",
"# environment: Visual Studio Code 1.95.2, python 3.13.0, Fedora release\n",
"# 41 (Forty One)\n",
"#\n",
"# notes: This is a private program.\n",
"#\n",
Expand Down Expand Up @@ -156,7 +156,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.12.4 ('.venv': pipenv)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -170,14 +170,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.13.0"
},
"orig_nbformat": 2,
"vscode": {
"interpreter": {
"hash": "a6e6494b31f5f594662f1a8e2d921aeddd6dcc141ee8d1d93913332492a0ba8d"
}
}
"orig_nbformat": 2
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
2 changes: 1 addition & 1 deletion src/sim_services/_instr_sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class HostedInstr:
class InstrMovStatus:
"""Status of moving instructions"""

moved: list[HostedInstr] = field(factory=list)
moved: list[HostedInstr] = attr.Factory(list)

mem_used: object = field(default=False, init=False)

Expand Down
13 changes: 7 additions & 6 deletions src/str_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,18 @@
#
# author: Mohammed El-Afifi (ME)
#
# environment: Visual Studio Code 1.89.0, python 3.11.9, Fedora release
# 40 (Forty)
# environment: Visual Studio Code 1.95.2, python 3.13.0, Fedora release
# 41 (Forty One)
#
# notes: This is a private program.
#
############################################################

import collections.abc
import typing

import attr

_GET_CANONICAL = str.lower


def format_obj(
cls_name: object, field_strings: collections.abc.Iterable[str]
Expand All @@ -58,7 +57,7 @@ def format_obj(
return f"{cls_name}({sep.join(field_strings)})"


@attr.frozen(order=True)
@attr.frozen(auto_attribs=False, order=True)
class ICaseString:
"""Case-insensitive string"""

Expand All @@ -69,7 +68,7 @@ def __contains__(self, item: str) -> bool:
`item` is the substring to search for.
"""
return _GET_CANONICAL(item) in _GET_CANONICAL(self.raw_str)
return self._GET_CANONICAL(item) in self._GET_CANONICAL(self.raw_str)

def __str__(self) -> str:
"""Return the printable string of this case-insensitive string.
Expand All @@ -79,4 +78,6 @@ def __str__(self) -> str:
"""
return self.raw_str

_GET_CANONICAL: typing.Final = staticmethod(str.lower)

raw_str: str = attr.field(eq=_GET_CANONICAL, order=_GET_CANONICAL)

0 comments on commit 9b0ccff

Please sign in to comment.