Skip to content

Commit

Permalink
Fix cast errors for python 3.8 (#42)
Browse files Browse the repository at this point in the history
* Fix cast errors for python 3.8
  • Loading branch information
kjelljorner authored Jun 28, 2022
1 parent e82a103 commit c348e90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.7.1] - 2022-06-27

### Fixed
- Fixed type errors related to ConformerEnsemble and Python 3.8

## [0.7.0] - 2022-06-22

### Added
Expand Down
4 changes: 2 additions & 2 deletions morfeus/conformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def add_inverted(self) -> ConformerEnsemble:
if not all([isinstance(energy, float) for energy in energies]):
self._add_conformers(conformer_coordinates)
else:
energies_ = cast(list[float], energies)
energies_ = cast("list[float]", energies)
self.add_conformers(conformer_coordinates, energies_)

return self
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def sort(self) -> ConformerEnsemble:
energies = [conformer.energy for conformer in self.conformers]
if not all([isinstance(energy, float) for energy in energies]):
raise ValueError("Not all conformers have energies.")
energies = cast(list[float], energies)
energies = cast("list[float]", energies)
indices = np.argsort(energies)
self.conformers = [self.conformers[i] for i in indices]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="morfeus-ml",
version="0.7.0",
version="0.7.1",
author="Kjell Jorner",
author_email="[email protected]",
description=DESCRIPTION,
Expand Down

0 comments on commit c348e90

Please sign in to comment.