Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

March 2024: Typos Update #3219

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,28 @@ WRONLY = "WRONLY"
Hax = "Hax"
# Big Sur
Sur = "Sur"
# Ignore the shorthand ans for answer
ans = "ans"
# Ignore the keyword arange
arange = "arange"
# Ignore IIS
IIS = "IIS"
iis = "iis"
# Ignore PN
PN = "PN"
# Ignore hd
hd = "hd"
# Ignore opf
opf = "opf"
# Ignore FRE
FRE = "FRE"
# Ignore MCH
MCH = "MCH"
# Ignore RO
ro = "ro"
RO = "RO"
# Ignore EOF - end of file
EOF = "EOF"
# Ignore lst as shorthand for list
lst = "lst"
# AS NEEDED: Add More Words Below
13 changes: 1 addition & 12 deletions pyomo/contrib/latex_printer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

# ___________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright (c) 2008-2023
# National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and
# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain
# rights in this software.
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

# Recommended just to build all of the appropriate things
import pyomo.environ

# Remove one layer of .latex_printer
# import statemnt is now:
# import statement is now:
# from pyomo.contrib.latex_printer import latex_printer
try:
from pyomo.contrib.latex_printer.latex_printer import latex_printer
Expand Down
4 changes: 2 additions & 2 deletions pyomo/core/base/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def pprint(self, ostream=None, verbose=False, prefix=""):

@property
def name(self):
"""Get the fully qualifed component name."""
"""Get the fully qualified component name."""
return self.getname(fully_qualified=True)

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

@property
def name(self):
"""Get the fully qualifed component name."""
"""Get the fully qualified component name."""
return self.getname(fully_qualified=True)

# Allow setting a component's name if it is not owned by a parent
Expand Down
2 changes: 1 addition & 1 deletion pyomo/core/base/indexed_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def __delitem__(self, index):

# this supports "del m.x[:,1]" through a simple recursive call
if index.__class__ is IndexedComponent_slice:
# Assert that this slice ws just generated
# Assert that this slice was just generated
assert len(index._call_stack) == 1
# Make a copy of the slicer items *before* we start
# iterating over it (since we will be removing items!).
Expand Down
2 changes: 1 addition & 1 deletion pyomo/core/base/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def Reference(reference, ctype=NOTSET):
:py:class:`IndexedComponent`.

If the indices associated with wildcards in the component slice all
refer to the same :py:class:`Set` objects for all data identifed by
refer to the same :py:class:`Set` objects for all data identified by
the slice, then the resulting indexed component will be indexed by
the product of those sets. However, if all data do not share common
set objects, or only a subset of indices in a multidimentional set
Expand Down
2 changes: 1 addition & 1 deletion pyomo/gdp/plugins/fix_disjuncts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GDP_Disjunct_Fixer(Transformation):

This reclassifies all disjuncts in the passed model instance as ctype Block
and deactivates the constraints and disjunctions within inactive disjuncts.
In addition, it transforms relvant LogicalConstraints and BooleanVars so
In addition, it transforms relevant LogicalConstraints and BooleanVars so
that the resulting model is a (MI)(N)LP (where it is only mixed-integer
if the model contains integer-domain Vars or BooleanVars which were not
indicator_vars of Disjuncs.
Expand Down
2 changes: 1 addition & 1 deletion pyomo/gdp/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def makeAnyIndexedDisjunctionOfDisjunctDatas():
build from DisjunctDatas. Identical mathematically to
makeDisjunctionOfDisjunctDatas.

Used to test that the right things happen for a case where soemone
Used to test that the right things happen for a case where someone
implements an algorithm which iteratively generates disjuncts and
retransforms"""
m = ConcreteModel()
Expand Down
6 changes: 3 additions & 3 deletions pyomo/network/foqus_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ def scc_calculation_order(self, sccNodes, ie, oe):
done = False
for i in range(len(sccNodes)):
for j in range(len(sccNodes)):
for ine in ie[i]:
for oute in oe[j]:
if ine == oute:
for in_e in ie[i]:
for out_e in oe[j]:
if in_e == out_e:
adj[j].append(i)
adjR[i].append(j)
done = True
Expand Down
24 changes: 14 additions & 10 deletions pyomo/solvers/plugins/solvers/GAMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def _get_version(self):
return _extract_version('')
from gams import GamsWorkspace

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

ws = GamsWorkspace(debug=DebugLevel.Off, working_directory=tmpdir)
t1 = ws.add_job_from_string(self._simple_model(n))
workspace = GamsWorkspace(debug=DebugLevel.Off, working_directory=tmpdir)
t1 = workspace.add_job_from_string(self._simple_model(n))
t1.run()
return True
except:
Expand Down Expand Up @@ -330,12 +330,12 @@ def solve(self, *args, **kwds):
if tmpdir is not None and os.path.exists(tmpdir):
newdir = False

ws = GamsWorkspace(
workspace = GamsWorkspace(
debug=DebugLevel.KeepFiles if keepfiles else DebugLevel.Off,
working_directory=tmpdir,
)

t1 = ws.add_job_from_string(output_file.getvalue())
t1 = workspace.add_job_from_string(output_file.getvalue())

try:
with OutputStream(tee=tee, logfile=logfile) as output_stream:
Expand All @@ -349,7 +349,9 @@ def solve(self, *args, **kwds):
# Always name working directory or delete files,
# regardless of any errors.
if keepfiles:
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
print(
"\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory
)
elif tmpdir is not None:
# Garbage collect all references to t1.out_db
# So that .gdx file can be deleted
Expand All @@ -359,7 +361,7 @@ def solve(self, *args, **kwds):
except:
# Catch other errors and remove files first
if keepfiles:
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
print("\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory)
elif tmpdir is not None:
# Garbage collect all references to t1.out_db
# So that .gdx file can be deleted
Expand Down Expand Up @@ -398,7 +400,9 @@ def solve(self, *args, **kwds):
extract_rc = 'rc' in model_suffixes

results = SolverResults()
results.problem.name = os.path.join(ws.working_directory, t1.name + '.gms')
results.problem.name = os.path.join(
workspace.working_directory, t1.name + '.gms'
)
results.problem.lower_bound = t1.out_db["OBJEST"].find_record().value
results.problem.upper_bound = t1.out_db["OBJEST"].find_record().value
results.problem.number_of_variables = t1.out_db["NUMVAR"].find_record().value
Expand Down Expand Up @@ -587,7 +591,7 @@ def solve(self, *args, **kwds):
results.solution.insert(soln)

if keepfiles:
print("\nGAMS WORKING DIRECTORY: %s\n" % ws.working_directory)
print("\nGAMS WORKING DIRECTORY: %s\n" % workspace.working_directory)
elif tmpdir is not None:
# Garbage collect all references to t1.out_db
# So that .gdx file can be deleted
Expand Down
Loading