Skip to content

Commit

Permalink
[Viz] Return early in NetworkArtist.edge_width()
Browse files Browse the repository at this point in the history
  • Loading branch information
arpastrana committed Oct 7, 2024
1 parent 2be6389 commit 370831b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Deprecated `jax_fdm.optimization.optimizers.scipy` in favor of `jax_fdm.optimization.optimizers.gradient_based`.
- Fixed bug. Return early in `NetworkArtist.edge_width()` if the artist edges list is empty.
- Fixed bug in `EdgesForceEqualGoal.prediction()`: the normalization mean of compressive edge forces was a negative number. This led to negative normalized variance values, which was plainly incorrect.
- `VertexGroupSupportParameter` inherits from `VertexGroupParameter` instead of `NodeGroupParameter`. This was a bug.

Expand Down
4 changes: 4 additions & 0 deletions src/jax_fdm/visualization/artists/network_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ def edge_width(self, width):

elif isinstance(width, Iterable) and len(width) == 2:
width_min, width_max = width

if not self.edges:
return

forces = [fabs(self.network.edge_force(edge)) for edge in self.edges]

if min(forces) == max(forces):
Expand Down

0 comments on commit 370831b

Please sign in to comment.