Skip to content

Commit 83c99ab

Browse files
committed
python/ New function generate_ndset().
* bibkeys.txt: Add LacKlaFon2017box, Muller1959sphere, RubMel1998simulation. * python/doc/source/conf.py: Fix to render plotly. * python/examples/plot_generate.py: New. * python/src/moocore/_moocore.py (generate_ndset): New. * python/pyproject.toml: Depend on plotly. * python/requirements_dev.txt: Add plotly.
1 parent 802a5f6 commit 83c99ab

File tree

11 files changed

+583
-18
lines changed

11 files changed

+583
-18
lines changed

bibkeys.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ Jen03
2121
JohAraMcGSch1991
2222
KnoCor2002cec
2323
KunLucPre1975jacm
24+
LacKlaFon2017box
2425
LopPaqStu09emaa
2526
LopVerDreDoe2025
2627
LopezIbanezPhD
2728
Molchanov2005theory
29+
Muller1959sphere
30+
RubMel1998simulation
2831
SchEsqLarCoe2012tec
2932
VelLam1998gp
3033
ZhoZhaJin2009igdx

python/doc/source/REFERENCES.bib

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ @article{KunLucPre1975jacm
268268
doi = {10.1145/321906.321910}
269269
}
270270

271+
@article{LacKlaFon2017box,
272+
author = {Renaud Lacour and Kathrin Klamroth and Carlos M. Fonseca },
273+
title = {A box decomposition algorithm to compute the hypervolume
274+
indicator},
275+
journal = {Computers \& Operations Research},
276+
year = 2017,
277+
volume = 79,
278+
pages = {347--360},
279+
doi = {10.1016/J.COR.2016.06.021}
280+
}
281+
271282
@article{LopVerDreDoe2025,
272283
author = { Manuel L{\'o}pez-Ib{\'a}{\~n}ez and Diederick Vermetten and Johann Dreo and Carola Doerr },
273284
title = {Using the Empirical Attainment Function for Analyzing
@@ -298,6 +309,19 @@ @article{LopVerDreDoe2025
298309
keywords = {EAF-based ECDF}
299310
}
300311

312+
@article{Muller1959sphere,
313+
author = {Mervin E. Muller},
314+
title = {A Note on a Method for Generating Points Uniformly on
315+
N-Dimensional Spheres},
316+
journal = {Communications of the ACM},
317+
year = 1959,
318+
volume = 2,
319+
number = 4,
320+
pages = {19--20},
321+
doi = {10.1145/377939.377946},
322+
keywords = {hypersphere, sampling}
323+
}
324+
301325
@article{SchEsqLarCoe2012tec,
302326
author = { Oliver Sch{\"u}tze and X. Esquivel and A. Lara and Carlos A. {Coello Coello} },
303327
journal = {IEEE Transactions on Evolutionary Computation},
@@ -613,6 +637,15 @@ @book{Molchanov2005theory
613637
keywords = {Vorob'ev expectation}
614638
}
615639

640+
@book{RubMel1998simulation,
641+
author = {R. Y. Rubinstein and B. Melamed},
642+
title = {Modern simulation and modeling},
643+
year = 1998,
644+
publisher = {Wiley},
645+
address = { New York, NY},
646+
notes = {Uniform sampling from the simplex.}
647+
}
648+
616649
@inproceedings{VelLam1998gp,
617650
year = 1998,
618651
publisher = {Stanford University Bookstore},

python/doc/source/conf.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@
1111
from datetime import date
1212
import sphinx
1313

14-
# Set plotly renderer to capture _repr_html_ for sphinx-gallery
15-
try:
16-
import plotly.io
17-
except ImportError:
18-
pass
19-
else:
20-
plotly.io.renderers.default = "sphinx_gallery"
21-
2214
import os
2315
import sys
2416

2517
# Building the docs requires installing the package.
2618
import moocore
2719

20+
# If extensions (or modules to document with autodoc) are in another directory,
21+
# add these directories to sys.path here. If the directory is relative to the
22+
# documentation root, use os.path.abspath to make it absolute, like shown here.
2823
sys.path.insert(0, os.path.abspath("."))
24+
2925
# Prevent ruff from deleting seemingly unused imports
3026
import my_unsrt_style # noqa: F401
3127

@@ -42,9 +38,10 @@
4238
# -- General configuration ---------------------------------------------------
4339
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
4440

45-
html_js_files = [
46-
"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"
47-
]
41+
# FIXME: This breaks plotly rendering.
42+
# html_js_files = [
43+
# "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"
44+
# ]
4845

4946
extensions = [
5047
"sphinx_design", # grid directive
@@ -238,6 +235,16 @@ def setup(app):
238235
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
239236
}
240237

238+
# Set plotly renderer to capture _repr_html_ for sphinx-gallery
239+
try:
240+
import plotly
241+
import plotly.io as pio
242+
243+
pio.renderers.default = "sphinx_gallery"
244+
except ImportError:
245+
plotly = None
246+
247+
241248
# From https://github.com/scikit-learn/scikit-learn/blob/main/doc/conf.py
242249
sphinx_gallery_conf = {
243250
"examples_dirs": "../../examples",
@@ -262,15 +269,12 @@ def setup(app):
262269
# "dependencies": "./binder/requirements.txt",
263270
# "use_jupyter_lab": True,
264271
# },
272+
"image_srcset": ["2x"],
273+
"nested_sections": True,
265274
# avoid generating too many cross links
266275
"inspect_global_variables": False,
267276
"remove_config_comments": True,
268277
"matplotlib_animations": True,
269278
# "plot_gallery": "True",
270279
# "recommender": {"enable": True, "n_examples": 5, "min_df": 12},
271-
# "reset_modules": ("matplotlib", "seaborn"),
272280
}
273-
# if with_jupyterlite:
274-
# sphinx_gallery_conf["jupyterlite"] = {
275-
# "notebook_modification_function": notebook_modification_function
276-
# }

python/doc/source/reference/functions.io.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ Transform data
2222
apply_within_sets
2323

2424

25+
Generate data
26+
-------------
27+
.. autosummary::
28+
:toctree: generated/
29+
30+
generate_ndset

python/doc/source/whatsnew/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ What's new
77
Version 0.1.9 (dev)
88
-------------------
99

10-
- New function: :func:`~moocore.any_dominated` to quickly detect if a set is
11-
nondominated.
10+
- New functions: :func:`~moocore.any_dominated` to quickly detect if a set is
11+
nondominated and :func:`~moocore.generate_ndset` to generate random
12+
nondominated sets with different shapes.
13+
- New example :ref:`sphx_glr_auto_examples_plot_generate.py`.
1214

1315

1416
Version 0.1.8 (15/07/2025)

0 commit comments

Comments
 (0)