Skip to content

Commit

Permalink
Remove __all__ from modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Feb 16, 2024
1 parent 42bd0a7 commit f43a49e
Show file tree
Hide file tree
Showing 74 changed files with 16 additions and 307 deletions.
2 changes: 0 additions & 2 deletions pyomo/common/_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
Management of Pyomo commands
"""

__all__ = ['pyomo_command', 'get_pyomo_commands']

import logging

logger = logging.getLogger('pyomo.common')
Expand Down
4 changes: 1 addition & 3 deletions pyomo/contrib/pynumero/interfaces/ampl_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
from pyomo.common.deprecation import deprecated
from pyomo.contrib.pynumero.interfaces.nlp import ExtendedNLP

__all__ = ['AslNLP', 'AmplNLP']


# ToDo: need to add support for modifying bounds.
# TODO: need to add support for modifying bounds.
# support for changing variable bounds seems possible.
# support for changing inequality bounds would require more work. (this is less frequent?)
# TODO: check performance impacts of caching - memory and computational time.
Expand Down
3 changes: 1 addition & 2 deletions pyomo/contrib/pynumero/interfaces/nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
.. rubric:: Contents
"""
import abc

__all__ = ['NLP']
import abc


class NLP(object, metaclass=abc.ABCMeta):
Expand Down
3 changes: 0 additions & 3 deletions pyomo/contrib/pynumero/interfaces/pyomo_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
from .external_grey_box import ExternalGreyBoxBlock


__all__ = ['PyomoNLP']


# TODO: There are todos in the code below
class PyomoNLP(AslNLP):
def __init__(self, pyomo_model, nl_file_options=None):
Expand Down
2 changes: 0 additions & 2 deletions pyomo/contrib/pynumero/sparse/block_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import logging
import warnings

__all__ = ['BlockMatrix', 'NotFullyDefinedBlockMatrixError']


logger = logging.getLogger(__name__)

Expand Down
2 changes: 0 additions & 2 deletions pyomo/contrib/pynumero/sparse/block_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
from ..dependencies import numpy as np
from .base_block import BaseBlockVector

__all__ = ['BlockVector', 'NotFullyDefinedBlockVectorError']


class NotFullyDefinedBlockVectorError(Exception):
pass
Expand Down
2 changes: 0 additions & 2 deletions pyomo/contrib/pynumero/sparse/mpi_block_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from scipy.sparse import coo_matrix
import operator

__all__ = ['MPIBlockMatrix']


def assert_block_structure(mat: MPIBlockMatrix):
if mat.has_undefined_row_sizes() or mat.has_undefined_col_sizes():
Expand Down
2 changes: 0 additions & 2 deletions pyomo/contrib/pynumero/sparse/mpi_block_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import numpy as np
import operator

__all__ = ['MPIBlockVector']


def assert_block_structure(vec):
if vec.has_none:
Expand Down
7 changes: 2 additions & 5 deletions pyomo/core/base/PyomoModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['Model', 'ConcreteModel', 'AbstractModel', 'global_option']

import logging
import sys
from weakref import ref as weakref_ref
Expand All @@ -20,7 +18,7 @@
from pyomo.common import timing
from pyomo.common.collections import Bunch
from pyomo.common.dependencies import pympler, pympler_available
from pyomo.common.deprecation import deprecated, deprecation_warning
from pyomo.common.deprecation import deprecated
from pyomo.common.gc_manager import PauseGC
from pyomo.common.log import is_debug_set
from pyomo.common.numeric_types import value
Expand All @@ -34,11 +32,10 @@
from pyomo.core.base.block import ScalarBlock
from pyomo.core.base.set import Set
from pyomo.core.base.componentuid import ComponentUID
from pyomo.core.base.transformation import TransformationFactory
from pyomo.core.base.label import CNameLabeler, CuidLabeler
from pyomo.dataportal.DataPortal import DataPortal

from pyomo.opt.results import SolverResults, Solution, SolverStatus, UndefinedData
from pyomo.opt.results import Solution, SolverStatus, UndefinedData

from contextlib import nullcontext
from io import StringIO
Expand Down
5 changes: 2 additions & 3 deletions pyomo/core/base/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['BuildAction']

import logging
import types

Expand All @@ -24,7 +22,8 @@


@ModelComponentFactory.register(
"A component that performs arbitrary actions during model construction. The action rule is applied to every index value."
"A component that performs arbitrary actions during model construction. "
"The action rule is applied to every index value."
)
class BuildAction(IndexedComponent):
"""A build action, which executes a rule for all valid indices.
Expand Down
14 changes: 0 additions & 14 deletions pyomo/core/base/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,7 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = [
'Block',
'TraversalStrategy',
'SortComponents',
'active_components',
'components',
'active_components_data',
'components_data',
'SimpleBlock',
'ScalarBlock',
]

import copy
import enum
import logging
import sys
import weakref
Expand All @@ -41,7 +28,6 @@
from pyomo.common.formatting import StreamIndenter
from pyomo.common.gc_manager import PauseGC
from pyomo.common.log import is_debug_set
from pyomo.common.sorting import sorted_robust
from pyomo.common.timing import ConstructionTimer
from pyomo.core.base.component import (
Component,
Expand Down
2 changes: 0 additions & 2 deletions pyomo/core/base/blockutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# the purpose of this file is to collect all utility methods that compute
# attributes of blocks, based on their contents.

__all__ = ['has_discrete_variables']

from pyomo.common import deprecated
from pyomo.core.base import Var

Expand Down
2 changes: 0 additions & 2 deletions pyomo/core/base/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['BuildCheck']

import logging
import types

Expand Down
3 changes: 0 additions & 3 deletions pyomo/core/base/component_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________


__all__ = ['items', 'display_items', 'display_name']

from pyomo.core.base.set import Set, RangeSet
from pyomo.core.base.param import Param
from pyomo.core.base.var import Var
Expand Down
3 changes: 0 additions & 3 deletions pyomo/core/base/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['Connector']

import logging
import sys
from weakref import ref as weakref_ref
Expand All @@ -26,7 +24,6 @@
from pyomo.core.base.global_set import UnindexedComponent_index
from pyomo.core.base.indexed_component import IndexedComponent
from pyomo.core.base.misc import apply_indexed_rule
from pyomo.core.base.transformation import TransformationFactory

logger = logging.getLogger('pyomo.core')

Expand Down
10 changes: 0 additions & 10 deletions pyomo/core/base/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = [
'Constraint',
'_ConstraintData',
'ConstraintList',
'simple_constraint_rule',
'simple_constraintlist_rule',
]

import io
import sys
import logging
import math
from weakref import ref as weakref_ref
from pyomo.common.pyomo_typing import overload

Expand Down
5 changes: 1 addition & 4 deletions pyomo/core/base/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['Expression', '_ExpressionData']

import sys
import logging
from weakref import ref as weakref_ref
from pyomo.common.pyomo_typing import overload

from pyomo.common.log import is_debug_set
from pyomo.common.deprecation import deprecated, RenamedClass
from pyomo.common.deprecation import RenamedClass
from pyomo.common.modeling import NOTSET
from pyomo.common.formatting import tabular_writer
from pyomo.common.timing import ConstructionTimer
Expand All @@ -32,7 +30,6 @@
from pyomo.core.base.component import ComponentData, ModelComponentFactory
from pyomo.core.base.global_set import UnindexedComponent_index
from pyomo.core.base.indexed_component import IndexedComponent, UnindexedComponent_set
from pyomo.core.base.misc import apply_indexed_rule
from pyomo.core.expr.numvalue import as_numeric
from pyomo.core.base.initializer import Initializer

Expand Down
2 changes: 0 additions & 2 deletions pyomo/core/base/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
from pyomo.core.base.component import Component
from pyomo.core.base.units_container import units

__all__ = ('ExternalFunction',)

logger = logging.getLogger('pyomo.core')
nan = float('nan')

Expand Down
8 changes: 1 addition & 7 deletions pyomo/core/base/indexed_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['IndexedComponent', 'ActiveIndexedComponent']

import enum
import inspect
import logging
import sys
import textwrap

from copy import deepcopy

import pyomo.core.expr as EXPR
import pyomo.core.base as BASE
from pyomo.core.base.indexed_component_slice import IndexedComponent_slice
Expand All @@ -32,9 +27,8 @@
from pyomo.common import DeveloperError
from pyomo.common.autoslots import fast_deepcopy
from pyomo.common.collections import ComponentSet
from pyomo.common.dependencies import numpy as np, numpy_available
from pyomo.common.deprecation import deprecated, deprecation_warning
from pyomo.common.errors import DeveloperError, TemplateExpressionError
from pyomo.common.errors import TemplateExpressionError
from pyomo.common.modeling import NOTSET
from pyomo.common.numeric_types import native_types
from pyomo.common.sorting import sorted_robust
Expand Down
2 changes: 0 additions & 2 deletions pyomo/core/base/instance2dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['instance2dat']

import types
from pyomo.core.base import Set, Param, value

Expand Down
11 changes: 0 additions & 11 deletions pyomo/core/base/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = [
'CounterLabeler',
'NumericLabeler',
'CNameLabeler',
'TextLabeler',
'AlphaNumericTextLabeler',
'NameLabeler',
'CuidLabeler',
'ShortNameLabeler',
]

import re

from pyomo.common.deprecation import deprecated
Expand Down
3 changes: 0 additions & 3 deletions pyomo/core/base/logical_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['LogicalConstraint', '_LogicalConstraintData', 'LogicalConstraintList']

import inspect
import sys
import logging
Expand All @@ -22,7 +20,6 @@
from pyomo.common.modeling import NOTSET
from pyomo.common.timing import ConstructionTimer

from pyomo.core.base.constraint import Constraint
from pyomo.core.expr.boolean_value import as_boolean, BooleanConstant
from pyomo.core.expr.numvalue import native_types, native_logical_types
from pyomo.core.base.component import ActiveComponentData, ModelComponentFactory
Expand Down
4 changes: 0 additions & 4 deletions pyomo/core/base/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['display']

import logging
import sys
import types

from pyomo.common.deprecation import relocated_module_attribute
from pyomo.core.expr import native_numeric_types

logger = logging.getLogger('pyomo.core')

Expand Down
10 changes: 0 additions & 10 deletions pyomo/core/base/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = (
'Objective',
'simple_objective_rule',
'_ObjectiveData',
'minimize',
'maximize',
'simple_objectivelist_rule',
'ObjectiveList',
)

import sys
import logging
from weakref import ref as weakref_ref
Expand Down
2 changes: 0 additions & 2 deletions pyomo/core/base/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

__all__ = ['Param']

import sys
import types
import logging
Expand Down
3 changes: 0 additions & 3 deletions pyomo/core/base/piecewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
*) piecewise for functions of the form y = f(x1,x2,...)
"""


__all__ = ['Piecewise']

import logging
import math
import itertools
Expand Down
Loading

0 comments on commit f43a49e

Please sign in to comment.