Skip to content

Commit 09fcf7e

Browse files
committed
Fix typos
1 parent e6645af commit 09fcf7e

File tree

12 files changed

+22
-21
lines changed

12 files changed

+22
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Dictionaries in python can now be sent to MAD-NG, and will be converted to a lua
55
Add an optional parameter to to_df and convert_to_dataframe methods to allow the user to specify to always return a pandas dataframe, instead of a tfs dataframe, when tfs is installed. \
66
Update the documentation and examples to work again. \
77
Remove iter restriction on MAD-NG objects that are not sequences, now all objects can be iterated over. \
8+
Renamed redirect_sterr to redirect_stderr in the MAD object, fixing a typo. \
89

910

1011
0.6.3 (2025/04/30)

examples/ex-benchmark-and-fork/ex-benchmark-and-fork.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from pymadng import MAD
99

10-
orginal_dir = os.getcwd()
10+
original_dir = os.getcwd()
1111
os.chdir(os.path.dirname(os.path.realpath(__file__)))
1212

1313
pid = os.fork()
@@ -104,4 +104,4 @@
104104
print(mad.mtbl2.header)
105105
sys.exit() # exit the child process
106106

107-
os.chdir(orginal_dir)
107+
os.chdir(original_dir)

examples/ex-fodo/ex-fodos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from pymadng import MAD
66

7-
orginal_dir = os.getcwd()
7+
original_dir = os.getcwd()
88
os.chdir(os.path.dirname(os.path.realpath(__file__)))
99

1010
# The typical way to communicate with MAD-NG is to use the send and recv methods.
@@ -51,4 +51,4 @@
5151
plt.plot(mad.mtbl.s, mad.mtbl.beta11)
5252
plt.show()
5353

54-
os.chdir(orginal_dir)
54+
os.chdir(original_dir)

examples/ex-lhc-couplingLocal/ex-lhc-couplingLocal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from pymadng import MAD
1414

15-
orginal_dir = os.getcwd()
15+
original_dir = os.getcwd()
1616
os.chdir(os.path.dirname(os.path.realpath(__file__)))
1717

1818

@@ -98,4 +98,4 @@
9898
t1 = time.time()
9999
print("Matching time: " + str(t1 - t0) + "s")
100100

101-
os.chdir(orginal_dir)
101+
os.chdir(original_dir)

examples/ex-managing-refs/ex-managing-refs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pymadng import MAD
77

8-
orginal_dir = os.getcwd()
8+
original_dir = os.getcwd()
99
os.chdir(os.path.dirname(os.path.realpath(__file__)))
1010

1111
mad = MAD() # Not being in context manager makes not difference.
@@ -42,4 +42,4 @@
4242
mad["myMatrix"] = mad.MAD.matrix(4).seq()
4343
print(mad.myMatrix, np.all(myMatrix == mad.myMatrix))
4444

45-
os.chdir(orginal_dir)
45+
os.chdir(original_dir)

examples/ex-ps-twiss/ex-ps-twiss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pymadng import MAD
44

5-
orginal_dir = os.getcwd()
5+
original_dir = os.getcwd()
66
os.chdir(os.path.dirname(os.path.realpath(__file__)))
77

88
with MAD(debug=False) as mad:
@@ -52,4 +52,4 @@
5252
print(df)
5353
print(mad.srv.to_df())
5454

55-
os.chdir(orginal_dir)
55+
os.chdir(original_dir)

src/pymadng/madp_object.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(
6868
raise_on_madng_error: bool = True,
6969
debug: bool = False,
7070
stdout: TextIO | str | Path = None,
71-
redirect_sterr: bool = False,
71+
redirect_stderr: bool = False,
7272
num_temp_vars: int = 8,
7373
ipython_use_jedi: bool = False,
7474
):
@@ -84,7 +84,7 @@ def __init__(
8484
raise_on_madng_error (bool, optional): If True, raises errors from MAD-NG immediately.
8585
debug (bool, optional): If True, enables detailed debugging output.
8686
stdout (TextIO | str | Path, optional): Destination for MAD-NG's standard output.
87-
redirect_sterr (bool, optional): If True, redirects stderr to stdout.
87+
redirect_stderr (bool, optional): If True, redirects stderr to stdout.
8888
num_temp_vars (int, optional): Maximum number of temporary variables to track.
8989
ipython_use_jedi (bool, optional): If True, allows IPython to use jedi for autocompletion.
9090
"""
@@ -96,7 +96,7 @@ def __init__(
9696
raise_on_madng_error=raise_on_madng_error,
9797
debug=debug,
9898
stdout=stdout,
99-
redirect_sterr=redirect_sterr,
99+
redirect_stderr=redirect_stderr,
100100
)
101101
self.__process.ipython_use_jedi = ipython_use_jedi
102102
self.__process.last_counter = last_counter(num_temp_vars)

src/pymadng/madp_pymad.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
raise_on_madng_error: bool = True,
4343
debug: bool = False,
4444
stdout: str | Path | TextIO = None,
45-
redirect_sterr: bool = False,
45+
redirect_stderr: bool = False,
4646
) -> None:
4747
self.py_name = py_name
4848

@@ -76,7 +76,7 @@ def __init__(
7676
) from e
7777

7878
# Redirect stderr to stdout, if specified
79-
if redirect_sterr:
79+
if redirect_stderr:
8080
stderr = stdout
8181
else:
8282
stderr = sys.stderr.fileno()

tests/test_communication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_recv_and_exec(self):
1515
self.assertEqual(a, 50)
1616

1717
def test_err(self):
18-
with MAD(stdout="/dev/null", redirect_sterr=True) as mad:
18+
with MAD(stdout="/dev/null", redirect_stderr=True) as mad:
1919
mad.send("py:__err(true)")
2020
mad.send("1+1") #Load error
2121
self.assertRaises(RuntimeError, mad.recv)
@@ -47,7 +47,7 @@ def test_send(self):
4747
self.assertEqual(mad.recv(), initString * 2)
4848

4949
def test_protected_send(self):
50-
with MAD(stdout="/dev/null", redirect_sterr=True, raise_on_madng_error=False) as mad:
50+
with MAD(stdout="/dev/null", redirect_stderr=True, raise_on_madng_error=False) as mad:
5151
mad.send("py:send('hello world'); a = nil/2")
5252
self.assertEqual(mad.recv(), "hello world") # python should not crash
5353
mad.send("py:send(1)")

tests/test_debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_err(self):
5454
self.assertFalse("***pymad.run:" in file_text)
5555

5656
# Run debug with stderr redirection
57-
with MAD(stdout=self.test_log1, redirect_sterr=True) as mad:
57+
with MAD(stdout=self.test_log1, redirect_stderr=True) as mad:
5858
mad.psend("a = nil/2")
5959
# receive the error before closing the pipe
6060
self.assertRaises(RuntimeError, mad.recv)

0 commit comments

Comments
 (0)