Skip to content

Commit

Permalink
Merge pull request #21 from industrial-optimization-group/test-docs
Browse files Browse the repository at this point in the history
Docs build successfully, migrated from automodsummary to autodocapi
  • Loading branch information
gialmisi committed Jul 16, 2021
2 parents d7c90fe + c7185f3 commit e9079d5
Show file tree
Hide file tree
Showing 53 changed files with 1,249 additions and 1,450 deletions.
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
image: testing

python:
version: 3.7
29 changes: 14 additions & 15 deletions desdeo_mcdm/interactive/ENautilus.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from typing import Dict, List, Optional, Tuple, Union

import numpy as np
from desdeo_mcdm.interactive.InteractiveMethod import InteractiveMethod
from desdeo_tools.interaction.request import BaseRequest
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances_argmin_min

from desdeo_mcdm.interactive.InteractiveMethod import InteractiveMethod


class ENautilusException(Exception):
"""Raised when an exception related to ENautilus is encountered.
Expand Down Expand Up @@ -131,22 +130,22 @@ def __init__(
Args:
pareto_front (np.ndarray): A two dimensional numpy array
representing a Pareto front with objective vectors on each of its
rows.
representing a Pareto front with objective vectors on each of its
rows.
ideal (np.ndarray): The ideal objective vector of the problem
being represented by the Pareto front.
being represented by the Pareto front.
nadir (np.ndarray): The nadir objective vector of the problem
being represented by the Pareto front.
being represented by the Pareto front.
objective_names (Optional[List[str]], optional): Names of the
objectives. List must match the number of columns in
pareto_front. Defaults to 'f1', 'f2', 'f3', ...
objectives. List must match the number of columns in
pareto_front. Defaults to 'f1', 'f2', 'f3', ...
minimize (Optional[List[int]], optional): Multipliers for each
objective. '-1' indicates maximization and '1' minimization.
Defaults to all objective values being minimized.
objective. '-1' indicates maximization and '1' minimization.
Defaults to all objective values being minimized (deprecated!).
Raises:
ENavigatorException: One or more dimension mismatches are
encountered among the supplies arguments.
encountered among the supplies arguments.
"""
if not pareto_front.ndim == 2:
raise ENautilusException(
Expand Down Expand Up @@ -282,14 +281,14 @@ def calculate_representative_points(
Args:
pareto_front (np.ndarray): The Pareto front.
subset_indices (List[int]): A list of indices representing the
subset of the points on the Pareto front for which the
representative points should be calculated.
subset of the points on the Pareto front for which the
representative points should be calculated.
n_points (int): The number of representative points to be calculated.
Returns:
np.ndarray: A 2D array of the most representative points. If the
subset of Pareto efficient points is less than n_points, returns
the subset of the Pareto front.
subset of Pareto efficient points is less than n_points, returns
the subset of the Pareto front.
"""
if len(np.atleast_1d(subset_indices)) > n_points:
kmeans = KMeans(n_clusters=n_points)
Expand Down
2 changes: 1 addition & 1 deletion desdeo_mcdm/interactive/InteractiveMethod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from desdeo_problem.Problem import MOProblem
from desdeo_problem.problem import MOProblem


class InteractiveMethod:
Expand Down
5 changes: 2 additions & 3 deletions desdeo_mcdm/interactive/NIMBUS.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pandas as pd
from desdeo_mcdm.interactive.InteractiveMethod import InteractiveMethod
from desdeo_mcdm.utilities.solvers import payoff_table_method
from desdeo_problem.Problem import DiscreteDataProblem, MOProblem
from desdeo_problem.problem import DiscreteDataProblem, MOProblem
from desdeo_tools.interaction.request import BaseRequest, SimplePlotRequest
from desdeo_tools.scalarization.ASF import AugmentedGuessASF, MaxOfTwoASF, PointMethodASF, SimpleASF, StomASF
from desdeo_tools.scalarization.Scalarizer import DiscreteScalarizer, Scalarizer
Expand Down Expand Up @@ -1097,8 +1097,7 @@ def c_1(x, f=None):
"""

import matplotlib.pyplot as plt
from desdeo_problem.Objective import _ScalarObjective
from desdeo_problem.Variable import variable_builder
from desdeo_problem.problem import _ScalarObjective, variable_builder

def f_1(xs: np.ndarray):
xs = np.atleast_2d(xs)
Expand Down

0 comments on commit e9079d5

Please sign in to comment.