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

Bump v14 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# viktor==13.4.0
plotly==5.9.0
pandas==1.4.4
viktor==14.0.0
plotly==5.14.1
pandas==1.5.3
8 changes: 4 additions & 4 deletions source/self_organizing_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pandas as pd

from viktor.core import UserException
from viktor.core import UserError

from .helpers import path_distance

Expand Down Expand Up @@ -94,7 +94,7 @@ def _get_neighborhood(center: int, radix: float, domain: np.ndarray) -> np.ndarr
return np.exp(-(distances * distances) / (2 * (radix * radix)))


def _get_route(cities: pd.DataFrame, network: np.ndarray) -> pd.Int64Index:
def _get_route(cities: pd.DataFrame, network: np.ndarray):
"""Get the route generated by the algorithm.

Args:
Expand Down Expand Up @@ -163,8 +163,8 @@ def self_organizing_maps(

# Check if any parameter has completely decayed.
if n < 1:
raise UserException("Radius has completely decayed, finishing execution at {} iterations".format(i))
raise UserError("Radius has completely decayed, finishing execution at {} iterations".format(i))
if learning_rate < 0.001:
raise UserException("Learning rate has completely decayed, finishing execution at {} iterations".format(i))
raise UserError("Learning rate has completely decayed, finishing execution at {} iterations".format(i))

return routes, np.arange(0, iterations + 1, 1).tolist(), distances
4 changes: 2 additions & 2 deletions viktor.config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python_version='3.9'
app_type = 'simple'
python_version='3.10'
app_type = 'editor'