From 6472d9632846214072dfb0457c2bdc7c801cc701 Mon Sep 17 00:00:00 2001 From: mmatera Date: Tue, 12 Dec 2023 11:40:40 -0300 Subject: [PATCH 1/4] update --- pymathics/hello/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymathics/hello/version.py b/pymathics/hello/version.py index ccf9b09..b045e29 100644 --- a/pymathics/hello/version.py +++ b/pymathics/hello/version.py @@ -5,4 +5,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="5.0.0dev1" # noqa +__version__="7.0.0dev1" # noqa From 46fd0597f6bd983d725158259a6e95bca4496807 Mon Sep 17 00:00:00 2001 From: mmatera Date: Tue, 12 Dec 2023 11:48:53 -0300 Subject: [PATCH 2/4] black --- test/test_hello.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_hello.py b/test/test_hello.py index eab9964..1414195 100644 --- a/test/test_hello.py +++ b/test/test_hello.py @@ -1,5 +1,3 @@ - - from mathics.core.load_builtin import import_and_load_builtins from mathics.session import MathicsSession From 0a201284c39d2d2dd6ef3fd8926234efb2b07bfa Mon Sep 17 00:00:00 2001 From: mmatera Date: Tue, 12 Dec 2023 11:54:28 -0300 Subject: [PATCH 3/4] all the fixes --- pymathics/hello/__main__.py | 5 +++-- test/test_hello.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pymathics/hello/__main__.py b/pymathics/hello/__main__.py index a20ea21..589e73b 100644 --- a/pymathics/hello/__main__.py +++ b/pymathics/hello/__main__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -from mathics.builtin.base import Builtin, String +from mathics.core.atoms import String +from mathics.core.builtin import Builtin class Hello(Builtin): @@ -13,7 +14,7 @@ class Hello(Builtin): """ # The function below should start with "apply" - def apply_with_name(self, person, evaluation): + def eval_with_name(self, person, evaluation): "%(name)s[person_String]" # %(name)s is just a more flexible way of writing "Hello". # If the class name changes, so will the above pattern. diff --git a/test/test_hello.py b/test/test_hello.py index c5f43e7..2414449 100644 --- a/test/test_hello.py +++ b/test/test_hello.py @@ -1,8 +1,11 @@ +# -*- coding: utf-8 -*- from mathics.core.load_builtin import import_and_load_builtins from mathics.session import MathicsSession -session = MathicsSession(add_builtin=True, catch_interrupt=False) +import_and_load_builtins() + +session = MathicsSession(character_encoding="ASCII") def check_evaluation(str_expr: str, expected: str, message=""): From 9688efa7335c397ad58f841b2f0572f6d55caa64 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 8 Aug 2024 09:47:12 -0300 Subject: [PATCH 4/4] addiing blanklines between and the examples in docstrings --- pymathics/hello/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pymathics/hello/__main__.py b/pymathics/hello/__main__.py index 589e73b..5ca73be 100644 --- a/pymathics/hello/__main__.py +++ b/pymathics/hello/__main__.py @@ -9,6 +9,7 @@ class Hello(Builtin):
'Hello'[$person$]
An example function in a Python-importable Mathics module. + >> Hello["World"] = Hello, World! """