Skip to content

Commit a2d546d

Browse files
authored
Merge pull request #3219 from mrmundt/typos-update
March 2024: Typos Update
2 parents ca75c27 + a69c1b8 commit a2d546d

File tree

9 files changed

+48
-31
lines changed

9 files changed

+48
-31
lines changed

Diff for: .github/workflows/typos.toml

+24
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,28 @@ WRONLY = "WRONLY"
4040
Hax = "Hax"
4141
# Big Sur
4242
Sur = "Sur"
43+
# Ignore the shorthand ans for answer
44+
ans = "ans"
45+
# Ignore the keyword arange
46+
arange = "arange"
47+
# Ignore IIS
48+
IIS = "IIS"
49+
iis = "iis"
50+
# Ignore PN
51+
PN = "PN"
52+
# Ignore hd
53+
hd = "hd"
54+
# Ignore opf
55+
opf = "opf"
56+
# Ignore FRE
57+
FRE = "FRE"
58+
# Ignore MCH
59+
MCH = "MCH"
60+
# Ignore RO
61+
ro = "ro"
62+
RO = "RO"
63+
# Ignore EOF - end of file
64+
EOF = "EOF"
65+
# Ignore lst as shorthand for list
66+
lst = "lst"
4367
# AS NEEDED: Add More Words Below

Diff for: pyomo/contrib/latex_printer/__init__.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,11 @@
99
# This software is distributed under the 3-clause BSD License.
1010
# ___________________________________________________________________________
1111

12-
# ___________________________________________________________________________
13-
#
14-
# Pyomo: Python Optimization Modeling Objects
15-
# Copyright (c) 2008-2023
16-
# National Technology and Engineering Solutions of Sandia, LLC
17-
# Under the terms of Contract DE-NA0003525 with National Technology and
18-
# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain
19-
# rights in this software.
20-
# This software is distributed under the 3-clause BSD License.
21-
# ___________________________________________________________________________
22-
2312
# Recommended just to build all of the appropriate things
2413
import pyomo.environ
2514

2615
# Remove one layer of .latex_printer
27-
# import statemnt is now:
16+
# import statement is now:
2817
# from pyomo.contrib.latex_printer import latex_printer
2918
try:
3019
from pyomo.contrib.latex_printer.latex_printer import latex_printer

Diff for: pyomo/core/base/component.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def pprint(self, ostream=None, verbose=False, prefix=""):
368368

369369
@property
370370
def name(self):
371-
"""Get the fully qualifed component name."""
371+
"""Get the fully qualified component name."""
372372
return self.getname(fully_qualified=True)
373373

374374
# Adding a setter here to help users adapt to the new
@@ -664,7 +664,7 @@ def getname(self, fully_qualified=False, name_buffer=None, relative_to=None):
664664

665665
@property
666666
def name(self):
667-
"""Get the fully qualifed component name."""
667+
"""Get the fully qualified component name."""
668668
return self.getname(fully_qualified=True)
669669

670670
# Allow setting a component's name if it is not owned by a parent

Diff for: pyomo/core/base/indexed_component.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def __delitem__(self, index):
731731

732732
# this supports "del m.x[:,1]" through a simple recursive call
733733
if index.__class__ is IndexedComponent_slice:
734-
# Assert that this slice ws just generated
734+
# Assert that this slice was just generated
735735
assert len(index._call_stack) == 1
736736
# Make a copy of the slicer items *before* we start
737737
# iterating over it (since we will be removing items!).

Diff for: pyomo/core/base/reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def Reference(reference, ctype=NOTSET):
579579
:py:class:`IndexedComponent`.
580580
581581
If the indices associated with wildcards in the component slice all
582-
refer to the same :py:class:`Set` objects for all data identifed by
582+
refer to the same :py:class:`Set` objects for all data identified by
583583
the slice, then the resulting indexed component will be indexed by
584584
the product of those sets. However, if all data do not share common
585585
set objects, or only a subset of indices in a multidimentional set

Diff for: pyomo/gdp/plugins/fix_disjuncts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GDP_Disjunct_Fixer(Transformation):
5252
5353
This reclassifies all disjuncts in the passed model instance as ctype Block
5454
and deactivates the constraints and disjunctions within inactive disjuncts.
55-
In addition, it transforms relvant LogicalConstraints and BooleanVars so
55+
In addition, it transforms relevant LogicalConstraints and BooleanVars so
5656
that the resulting model is a (MI)(N)LP (where it is only mixed-integer
5757
if the model contains integer-domain Vars or BooleanVars which were not
5858
indicator_vars of Disjuncs.

Diff for: pyomo/gdp/tests/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ def makeAnyIndexedDisjunctionOfDisjunctDatas():
840840
build from DisjunctDatas. Identical mathematically to
841841
makeDisjunctionOfDisjunctDatas.
842842
843-
Used to test that the right things happen for a case where soemone
843+
Used to test that the right things happen for a case where someone
844844
implements an algorithm which iteratively generates disjuncts and
845845
retransforms"""
846846
m = ConcreteModel()

Diff for: pyomo/network/foqus_graph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ def scc_calculation_order(self, sccNodes, ie, oe):
358358
done = False
359359
for i in range(len(sccNodes)):
360360
for j in range(len(sccNodes)):
361-
for ine in ie[i]:
362-
for oute in oe[j]:
363-
if ine == oute:
361+
for in_e in ie[i]:
362+
for out_e in oe[j]:
363+
if in_e == out_e:
364364
adj[j].append(i)
365365
adjR[i].append(j)
366366
done = True

Diff for: pyomo/solvers/plugins/solvers/GAMS.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def _get_version(self):
198198
return _extract_version('')
199199
from gams import GamsWorkspace
200200

201-
ws = GamsWorkspace()
202-
version = tuple(int(i) for i in ws._version.split('.')[:4])
201+
workspace = GamsWorkspace()
202+
version = tuple(int(i) for i in workspace._version.split('.')[:4])
203203
while len(version) < 4:
204204
version += (0,)
205205
return version
@@ -209,8 +209,8 @@ def _run_simple_model(self, n):
209209
try:
210210
from gams import GamsWorkspace, DebugLevel
211211

212-
ws = GamsWorkspace(debug=DebugLevel.Off, working_directory=tmpdir)
213-
t1 = ws.add_job_from_string(self._simple_model(n))
212+
workspace = GamsWorkspace(debug=DebugLevel.Off, working_directory=tmpdir)
213+
t1 = workspace.add_job_from_string(self._simple_model(n))
214214
t1.run()
215215
return True
216216
except:
@@ -330,12 +330,12 @@ def solve(self, *args, **kwds):
330330
if tmpdir is not None and os.path.exists(tmpdir):
331331
newdir = False
332332

333-
ws = GamsWorkspace(
333+
workspace = GamsWorkspace(
334334
debug=DebugLevel.KeepFiles if keepfiles else DebugLevel.Off,
335335
working_directory=tmpdir,
336336
)
337337

338-
t1 = ws.add_job_from_string(output_file.getvalue())
338+
t1 = workspace.add_job_from_string(output_file.getvalue())
339339

340340
try:
341341
with OutputStream(tee=tee, logfile=logfile) as output_stream:
@@ -349,7 +349,9 @@ def solve(self, *args, **kwds):
349349
# Always name working directory or delete files,
350350
# regardless of any errors.
351351
if keepfiles:
352-
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
352+
print(
353+
"\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory
354+
)
353355
elif tmpdir is not None:
354356
# Garbage collect all references to t1.out_db
355357
# So that .gdx file can be deleted
@@ -359,7 +361,7 @@ def solve(self, *args, **kwds):
359361
except:
360362
# Catch other errors and remove files first
361363
if keepfiles:
362-
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
364+
print("\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory)
363365
elif tmpdir is not None:
364366
# Garbage collect all references to t1.out_db
365367
# So that .gdx file can be deleted
@@ -398,7 +400,9 @@ def solve(self, *args, **kwds):
398400
extract_rc = 'rc' in model_suffixes
399401

400402
results = SolverResults()
401-
results.problem.name = os.path.join(ws.working_directory, t1.name + '.gms')
403+
results.problem.name = os.path.join(
404+
workspace.working_directory, t1.name + '.gms'
405+
)
402406
results.problem.lower_bound = t1.out_db["OBJEST"].find_record().value
403407
results.problem.upper_bound = t1.out_db["OBJEST"].find_record().value
404408
results.problem.number_of_variables = t1.out_db["NUMVAR"].find_record().value
@@ -587,7 +591,7 @@ def solve(self, *args, **kwds):
587591
results.solution.insert(soln)
588592

589593
if keepfiles:
590-
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
594+
print("\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory)
591595
elif tmpdir is not None:
592596
# Garbage collect all references to t1.out_db
593597
# So that .gdx file can be deleted

0 commit comments

Comments
 (0)