Skip to content

Commit

Permalink
remove duplicate find_distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsKue committed May 31, 2024
1 parent 2678d07 commit b4d4c1b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions bayesflow/experimental/distributions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@

from .distribution import Distribution
from .normal import Normal


def find_distribution(distribution: str | Distribution | type(Distribution)) -> Distribution:
if isinstance(distribution, Distribution):
return distribution
if isinstance(distribution, type):
return Distribution()

match distribution:
case "normal":
distribution = Normal()
case str() as unknown_distribution:
raise ValueError(f"Distribution '{unknown_distribution}' is unknown or not yet supported by name.")
case other:
raise TypeError(f"Unknown distribution type: {other}")

return distribution

0 comments on commit b4d4c1b

Please sign in to comment.