Skip to content

Commit

Permalink
minor bug fixes and dependency version stepping
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed May 31, 2023
1 parent 8a142f4 commit d81858d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
5 changes: 3 additions & 2 deletions moptipyapps/binpacking2d/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,15 @@ def __new__(cls, name: str,
width, height, repetitions = row
width = check_int_range(int(width), "width", 1, max_dim)
height = check_int_range(int(height), "height", 1, max_dim)
item_area += (width * height)
repetitions = check_int_range(int(repetitions), "repetitions",
1, 100_000_000)
item_area += (width * height * repetitions)
max_size = max(width, height)
if (width > min_dim) and (height > min_dim):
raise ValueError(
f"object with width={width} and height={height} does "
f"not fit into bin with width={width} and "
f"height={height}.")
check_int_range(int(repetitions), "repetitions", 1, 100_000_000)
n_items += repetitions

obj: Final[Instance] = super().__new__(
Expand Down
16 changes: 8 additions & 8 deletions moptipyapps/binpacking2d/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

from moptipyapps.binpacking2d.instance import Instance

#: the index of the ID
#: the index of the ID in a :class:`Packing` row
IDX_ID: Final[int] = 0
#: the index of the bin
#: the index of the bin in a :class:`Packing` row
IDX_BIN: Final[int] = 1
#: the index of the left x coordinate
#: the index of the left x coordinate in a :class:`Packing` row
IDX_LEFT_X: Final[int] = 2
#: the index of the bottom y coordinate
#: the index of the bottom y coordinate in a :class:`Packing` row
IDX_BOTTOM_Y: Final[int] = 3
#: the index of the right x coordinate
#: the index of the right x coordinate in a :class:`Packing` row
IDX_RIGHT_X: Final[int] = 4
#: the index of the top y coordinate
#: the index of the top y coordinate in a :class:`Packing` row
IDX_TOP_Y: Final[int] = 5


Expand All @@ -41,10 +41,10 @@ class Packing(Component, np.ndarray):

def __new__(cls, instance: Instance) -> "Packing":
"""
Create an instance of the 2D bin packing problem.
Create an solution record for the 2D bin packing problem.
:param cls: the class
:param instance: the instance
:param instance: the solution record
"""
if not isinstance(instance, Instance):
raise type_error(instance, "instance", Instance)
Expand Down
2 changes: 1 addition & 1 deletion moptipyapps/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""An internal file with the version of the `moptipyapps` package."""
from typing import Final

__version__: Final[str] = "0.8.2"
__version__: Final[str] = "0.8.3"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=65.6.3"]
requires = ["setuptools>=67.8.0"]
build-backend = "setuptools.build_meta"
19 changes: 8 additions & 11 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,28 @@ myst-parser >= 1.0.0
# issues, for possible bugs, for unnecessary code or imports, and for other
# things that can be improved. If all checks of all of these tools pass, then
# we probably have good quality code.
autoflake >= 1.7.8
autoflake >= 2.1.1
bandit >= 1.7.5
coverage >= 7.2.6
coverage >= 7.2.7
coverage-badge >= 1.1.0
dlint >= 0.14.1
dodgy >= 0.2.1
flake8 >= 5.0.4
flake8-bugbear >= 23.3.12
flake8-eradicate >= 1.4.0
flake8 >= 6.0.0
flake8-bugbear >= 23.5.9
flake8-eradicate >= 1.5.0
flake8-use-fstring >= 1.4
mypy >= 1.3.0
pycodestyle >= 2.9.1
pycodestyle >= 2.10.0
pydocstyle >= 6.3.0
pyflakes >= 2.5.0
pyflakes >= 3.0.1
pylint >= 2.17.4
pyroma >= 4.2
ruff >= 0.0.270
semgrep >= 1.23.0
semgrep >= 1.24.0
tryceratops >= 2.3.2
unimport >= 0.16.0
vulture >= 2.7

# yaml is used only in tests and examples.
pyyaml >= 6.0

# minify_html is needed to minify html output. Our documentation is fairly
# large. We apply this tool to try to reduce the file size of the
# documentation, by, e.g., removing useless white space.
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# `moptipy` provides the basic optimization infrastructure and the spaces and
# tools that we use for optimization.
moptipy >= 0.9.69
moptipy >= 0.9.71

# `numpy` is needed for its efficient data structures.
numpy >= 1.24.3
Expand All @@ -38,4 +38,4 @@ matplotlib >= 3.7.1
# They are also used to check the URLs in the README.md as part of the build
# process, we check all the URLs in the README.md file..
urllib3 >= 1.26.16
certifi >= 2023.05.7
certifi >= 2023.5.7
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ project_urls =
[options]
include_package_data = True
install_requires =
certifi >= 2023.05.7
moptipy >= 0.9.69
certifi >= 2023.5.7
moptipy >= 0.9.71
numpy >= 1.24.3
numba >= 0.57.0
matplotlib >= 3.7.1
Expand Down

0 comments on commit d81858d

Please sign in to comment.