Skip to content

Commit

Permalink
feat: update exports (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtth committed May 21, 2024
1 parent 23b11bb commit c5c315e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
3 changes: 2 additions & 1 deletion opvious/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from .client import Client, ClientSetting, Problem
from .common import __version__
from .common import __version__, Annotation
from .data.outcomes import (
AbortedOutcome,
FailedOutcome,
Expand Down Expand Up @@ -64,6 +64,7 @@
"load_notebook_models",
"modeling",
# Solves
"Annotation",
"DimensionArgument",
"EpsilonConstraint",
"Key",
Expand Down
9 changes: 0 additions & 9 deletions opvious/modeling/fragments.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ def __iter__(self) -> Iterable[Any]:
return (untuple(t) for t in cross(self.masked))


MaskedSubset = MaskedSubspace # Deprecated alias


class DerivedVariable(ModelFragment):
"""Variable equal to a given equation
Expand Down Expand Up @@ -220,9 +217,6 @@ def wrapper(fn):
return wrapper


Magnitude = MagnitudeVariable # Deprecated alias


class ActivationVariable(ModelFragment):
"""Indicator variable activation fragment
Expand Down Expand Up @@ -347,9 +341,6 @@ def __call__(self, *subs: ExpressionLike) -> Expression:
raise NotImplementedError()


ActivationIndicator = ActivationVariable # Deprecated alias


@method_decorator(require_call=True)
def activation_variable(
*quantifiables: Quantifiable,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "opvious"
version = "0.19.0rc3"
version = "0.19.0rc4"
description = "Opvious Python SDK"
authors = ["Opvious Engineering <oss@opvious.io>"]
readme = "README.md"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self) -> None:
self.production = om.Variable.non_negative(
self.steps, upper_bound=self.demand.total(absolute=True)
)
self.production_indicator = om.fragments.ActivationIndicator(
self.production_indicator = om.fragments.ActivationVariable(
tensor=self.production,
)
self.inventory = om.Variable.non_negative(self.steps)
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(self) -> None:
(self.friends, self.friends),
qualifiers=["sender", "recipient"],
)
self.tranferred_indicator = om.fragments.ActivationIndicator(
self.tranferred_indicator = om.fragments.ActivationVariable(
tensor=self.transferred,
upper_bound=self.overall_cost(),
)
Expand Down Expand Up @@ -187,7 +187,7 @@ class BinPacking(om.Model):
bin_max_weight = om.Parameter.non_negative()

assigned = om.Variable.indicator(bins, items)
used = om.fragments.ActivationIndicator(assigned, projection=1)
used = om.fragments.ActivationVariable(assigned, projection=1)

@om.objective
def minimize_bins_used(self):
Expand Down

0 comments on commit c5c315e

Please sign in to comment.