Skip to content

Commit 220b46a

Browse files
committed
review
1 parent 02de310 commit 220b46a

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

doc/genetic_op_utils.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Generic optimization utilities
2+
==============================
3+
4+
.. autofunction:: pygmo.sbx_crossover
5+
6+
-------------------------------------------------------
7+
8+
.. autofunction:: pygmo.polynomial_mutation

pygmo/core.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ PYBIND11_MODULE(core, m)
357357
return pygmo::vector_to_ndarr<py::array_t<double>>(retval);
358358
},
359359
pygmo::batch_random_decision_vector_docstring().c_str(), py::arg("prob"), py::arg("n"));
360+
#if (PAGMO_VERSION_MAJOR > 2 && PAGMO_VERSION_MINOR >= 15)
360361

361362
// Genetic operators
362363
m.def(
@@ -388,7 +389,7 @@ PYBIND11_MODULE(core, m)
388389
},
389390
pygmo::polynomial_mutation_docstring().c_str(), py::arg("dv"), py::arg("bounds"), py::arg("nix"),
390391
py::arg("p_m"), py::arg("eta_m"), py::arg("seed"));
391-
392+
#endif
392393
// Hypervolume class
393394
py::class_<pg::hypervolume> hv_class(m, "hypervolume", "Hypervolume Class");
394395
hv_class

pygmo/docstrings.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ individuals by calling the :func:`pygmo.sort_population_mo()` function.
9191
:attr:`~pygmo.problem.c_tol` attribute from the population's problem is used.
9292
9393
Returns:
94-
:class:`float`: the index of the best individual
94+
:class:`int`: the index of the best individual
9595
9696
Raises:
9797
ValueError: if the problem is multiobjective and thus a best individual is not well defined, or if the population is empty
@@ -115,7 +115,7 @@ individuals by calling the :func:`pygmo.sort_population_mo()` function.
115115
tol (:class:`float` or array-like object): scalar tolerance or vector of tolerances to be applied to each constraints
116116
117117
Returns:
118-
:class:`float`: the index of the worst individual
118+
:class:`int`: the index of the worst individual
119119
120120
Raises:
121121
ValueError: if the problem is multiobjective and thus a worst individual is not well defined, or if the population is empty
@@ -298,7 +298,7 @@ std::string population_get_seed_docstring()
298298
This method will return the random seed of the population.
299299
300300
Returns:
301-
:class:`float`: the random seed of the population
301+
:class:`int`: the random seed of the population
302302
303303
)";
304304
}
@@ -602,7 +602,7 @@ will be assumed. The number of objectives returned by the UDP is checked upon th
602602
of a :class:`~pygmo.problem`.
603603
604604
Returns:
605-
:class:`float`: the number of objectives of the problem
605+
:class:`int`: the number of objectives of the problem
606606
607607
)";
608608
}
@@ -617,7 +617,7 @@ This method will return :math:`n_{x}`, the dimension of the problem as establish
617617
the bounds returned by :func:`~pygmo.problem.get_bounds()`.
618618
619619
Returns:
620-
:class:`float`: the dimension of the problem
620+
:class:`int`: the dimension of the problem
621621
622622
)";
623623
}
@@ -636,7 +636,7 @@ The integer dimension returned by the UDP is checked upon the construction
636636
of a :class:`~pygmo.problem`.
637637
638638
Returns:
639-
:class:`float`: the integer dimension of the problem
639+
:class:`int`: the integer dimension of the problem
640640
641641
)";
642642
}
@@ -650,7 +650,7 @@ Continuous dimension of the problem.
650650
This method will return :math:`n_{cx}`, the continuous dimension of the problem.
651651
652652
Returns:
653-
:class:`float`: the continuous dimension of the problem
653+
:class:`int`: the continuous dimension of the problem
654654
655655
)";
656656
}
@@ -665,7 +665,7 @@ This method will return :math:`n_{f}`, the dimension of the fitness, which is th
665665
:math:`n_{obj}`, :math:`n_{ec}` and :math:`n_{ic}`.
666666
667667
Returns:
668-
:class:`float`: the dimension of the fitness
668+
:class:`int`: the dimension of the fitness
669669
670670
)";
671671
}
@@ -684,7 +684,7 @@ The number of equality constraints returned by the UDP is checked upon the const
684684
of a :class:`~pygmo.problem`.
685685
686686
Returns:
687-
:class:`float`: the number of equality constraints of the problem
687+
:class:`int`: the number of equality constraints of the problem
688688
689689
)";
690690
}
@@ -703,7 +703,7 @@ The number of inequality constraints returned by the UDP is checked upon the con
703703
of a :class:`~pygmo.problem`.
704704
705705
Returns:
706-
:class:`float`: the number of inequality constraints of the problem
706+
:class:`int`: the number of inequality constraints of the problem
707707
708708
)";
709709
}
@@ -718,7 +718,7 @@ This method will return the sum of the output of :func:`~pygmo.problem.get_nic()
718718
:func:`~pygmo.problem.get_nec()` (i.e., the total number of constraints).
719719
720720
Returns:
721-
:class:`float`: the total number of constraints of the problem
721+
:class:`int`: the total number of constraints of the problem
722722
723723
)";
724724
}
@@ -1589,7 +1589,7 @@ std::string mbh_get_seed_docstring()
15891589
Get the seed value that was used for the construction of this :class:`~pygmo.mbh`.
15901590
15911591
Returns:
1592-
:class:`float`: the seed value
1592+
:class:`int`: the seed value
15931593
15941594
)";
15951595
}
@@ -1601,7 +1601,7 @@ std::string mbh_get_verbosity_docstring()
16011601
Get the verbosity level value that was used for the construction of this :class:`~pygmo.mbh`.
16021602
16031603
Returns:
1604-
:class:`float`: the verbosity level
1604+
:class:`int`: the verbosity level
16051605
16061606
)";
16071607
}
@@ -2064,7 +2064,7 @@ std::string generic_uda_get_seed_docstring()
20642064
This method will return the random seed used internally by this uda.
20652065
20662066
Returns:
2067-
:class:`float`: the random seed of the population
2067+
:class:`int`: the random seed of the population
20682068
)";
20692069
}
20702070

@@ -5392,7 +5392,7 @@ The ``maxeval`` stopping criterion instructs the solver to stop when the number
53925392
``maxeval``. Defaults to 0 (that is, this stopping criterion is disabled by default).
53935393
53945394
Returns:
5395-
:class:`float`: the value of the ``maxeval`` stopping criterion
5395+
:class:`int`: the value of the ``maxeval`` stopping criterion
53965396
53975397
Raises:
53985398
unspecified: any exception thrown by failures at the intersection between C++ and Python (e.g.,
@@ -5449,7 +5449,7 @@ std::string nlopt_get_last_opt_result_docstring()
54495449
Get the result of the last optimisation.
54505450
54515451
Returns:
5452-
:class:`float`: the NLopt return code for the last optimisation run, or ``NLOPT_SUCCESS`` if no optimisations have been run yet
5452+
:class:`int`: the NLopt return code for the last optimisation run, or ``NLOPT_SUCCESS`` if no optimisations have been run yet
54535453
54545454
Raises:
54555455
unspecified: any exception thrown by failures at the intersection between C++ and Python (e.g.,
@@ -5954,7 +5954,7 @@ std::string ipopt_get_last_opt_result_docstring()
59545954
Get the result of the last optimisation.
59555955
59565956
Returns:
5957-
:class:`float`: the Ipopt return code for the last optimisation run, or ``Ipopt::Solve_Succeeded`` if no optimisations have been run yet
5957+
:class:`int`: the Ipopt return code for the last optimisation run, or ``Ipopt::Solve_Succeeded`` if no optimisations have been run yet
59585958
59595959
Raises:
59605960
unspecified: any exception thrown by failures at the intersection between C++ and Python (e.g.,

0 commit comments

Comments
 (0)