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

Fix warnings #499

Merged
merged 3 commits into from
Jul 5, 2023
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
16 changes: 0 additions & 16 deletions src/stk/_internal/building_block.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import os
import typing
import warnings
from collections.abc import Collection, Iterable, Iterator
from functools import partial

Expand Down Expand Up @@ -38,12 +37,6 @@ class BuildingBlock(Molecule):
_init_funcs = {
".mol": partial(rdkit.MolFromMolFile, sanitize=False, removeHs=False),
".sdf": partial(rdkit.MolFromMolFile, sanitize=False, removeHs=False),
".pdb": partial(
rdkit.MolFromPDBFile,
sanitize=False,
removeHs=False,
proximityBonding=False,
),
}

_placer_ids: frozenset[int]
Expand Down Expand Up @@ -452,15 +445,6 @@ def init_from_file(

_, extension = os.path.splitext(path)

if extension == ".pdb":
warnings.warn(
"Loading from .pdb files is deprecated and will be "
"removed from stk versions released after 1st Nov "
"2022. Please use .mol files for loading molecules "
"instead.",
category=FutureWarning,
)

if extension not in cls._init_funcs:
raise ValueError(f'Unable to initialize from "{extension}" files.')
# This remake needs to be here because molecules loaded
Expand Down
2 changes: 1 addition & 1 deletion src/stk/_internal/ea/plotters/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _plot(self, population, counter):
ax.get_legend().remove()
# https://tinyurl.com/2p9drmkh
plt.rcParams["axes.grid"] = False
ax.figure.colorbar(sm).set_label(self._heat_map_label)
ax.figure.colorbar(sm, ax=ax).set_label(self._heat_map_label)
plt.tight_layout()
fig.savefig(f"{self._filename}_{self._plots}.png", dpi=fig.dpi)
plt.close("all")
2 changes: 1 addition & 1 deletion src/stk/_internal/topology_graphs/cof/cof.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def __init__(

self._check_building_block_vertices(
num_vertices=(
np.product(lattice_size) * len(self._vertex_prototypes)
np.prod(lattice_size) * len(self._vertex_prototypes)
),
building_block_vertices=building_block_vertices,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@pytest.fixture(
params=[
"building_block.mol",
"building_block.pdb",
],
)
def path(tmpdir, request):
Expand Down