Registry / data / moocore

moocore

JSON →
library0.3.1pypypi✓ verified 85d ago

moocore provides fast implementations of core mathematical functions and algorithms for multi-objective optimization. While available in R, this entry focuses on the Python package (v0.2.0). It offers functionalities for generating and transforming non-dominated sets, identifying dominated vectors, and computing various quality metrics like hypervolume and epsilon indicator. The critical functionality is implemented in C for high performance. The project maintains a frequent release cadence, often with minor updates.

pip install moocore
INSTALL
IMPORT
SIG · MOOCORE
M
moocore
datapythonv0.3.1
Install
3.8s avg
Import
403ms
Disk
91MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 4.08s
py 3.11
✓ —
✓ 3.78s
py 3.12
✓ —
✓ 3.65s
py 3.13
✓ —
✓ 3.68s
py 3.9
✕ build_error
✕ build_error
91MB installed
● package 91MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

moocore
import moocore
filter_dominated
import moocore points = moocore.filter_dominated(data)
Hypervolume
import moocore hv_calculator = moocore.Hypervolume(reference=ref_point)

This quickstart demonstrates basic usage of moocore for identifying and filtering non-dominated points and calculating the hypervolume indicator. It assumes a minimization problem for all objectives. The `moocore.is_nondominated` function returns a boolean mask, while `moocore.filter_dominated` directly returns the non-dominated points. The `moocore.Hypervolume` class is initialized with a reference point and then called with the set of points.

import numpy as np import moocore # Example data: a set of 2D points (assuming minimization) # Each row is a point, each column is an objective data = np.array([ [1.0, 5.0], [2.0, 3.0], [3.0, 2.0], [4.0, 1.0], [2.5, 2.5], [1.5, 4.0] ]) # 1. Identify non-dominated points nondominated_points_mask = moocore.is_nondominated(data) nondominated_set = data[nondominated_points_mask] print(f"Non-dominated points:\n{nondominated_set}") # 2. Filter dominated points (returns only non-dominated ones) filtered_set = moocore.filter_dominated(data) print(f"Filtered (non-dominated) set:\n{filtered_set}") # 3. Calculate Hypervolume (requires a reference point) # Reference point should be worse than all points in the objective space # For minimization, this means typically larger values. ref_point = np.array([5.0, 5.0]) # Example reference point hv_calculator = moocore.Hypervolume(reference=ref_point) hypervolume_value = hv_calculator(filtered_set) print(f"Hypervolume of the non-dominated set: {hypervolume_value}")
Debug
Known issues
gotchaPerformance vs. Numerical Precision: `moocore` prioritizes speed through C implementations, which might lead to minor numerical differences compared to other multi-objective optimization libraries that use different underlying algorithms or floating-point precision strategies. Users migrating from other libraries should verify results for critical applications.
fix
Thoroughly test `moocore`'s output against your established benchmarks or reference implementations, especially for edge cases or when high numerical precision is paramount. Consult the documentation for algorithm specifics.
affects: All versions
breakingC-Core Error Handling: Older versions might terminate abruptly due to `exit()` or `abort()` calls within the C core instead of raising Python exceptions. While there are ongoing efforts to improve this, users might encounter unexpected program termination instead of catchable Python errors in some scenarios.
fix
Ensure your C/C++ compiler is up-to-date if building from source. For installed versions, check GitHub issues for updates on C-core error handling. Isolate `moocore` calls in `try-except` blocks to handle potential exceptions, though abrupt termination may still bypass this for some unhandled C-level errors.
affects: <=0.2.0 (potentially earlier development versions)
gotchaImplicit NumPy Dependency: Although `numpy` is not a strict PyPI dependency, most examples and practical usage patterns for data handling within `moocore` implicitly rely on `numpy` arrays. Directly passing Python lists to certain functions may lead to performance overhead or unexpected behavior if not properly handled internally.
fix
Always convert input data to `numpy` arrays before passing them to `moocore` functions, e.g., `data = np.asarray(your_list_of_points)`. Explicitly install `numpy` in your environment (`pip install numpy`).
affects: All versions
gotchaLack of Explicit Breaking Change Notes for 0.2.0: Despite incrementing the minor version from 0.1.x to 0.2.0, no explicit breaking changes were highlighted in the release notes. Users upgrading from 0.1.x versions should exercise caution and thoroughly test their applications, as underlying algorithm changes or interface adjustments might have occurred without explicit documentation.
fix
Review the full changelog on GitHub, examine the `git diff` between versions if possible, and run comprehensive regression tests on your code when upgrading from any 0.1.x version to 0.2.0 or newer.
affects: From 0.1.x to 0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'moocore'
The 'moocore' package is not installed in your current Python environment, or the installation was incomplete/corrupted, preventing the Python interpreter from locating the module.
fix
Ensure you have successfully installed the package using pip: `pip install moocore`. If installed in a virtual environment, activate it before running your script. Verify installation with `pip show moocore`.
error: command 'gcc' failed with exit status 1
The 'moocore' library relies on C extensions for performance, and this error indicates that the C/C++ compiler (e.g., GCC, MSVC) failed to compile these extensions during installation. This often happens if the necessary build tools are not installed or configured correctly on your system.
fix
Install the required C/C++ build tools for your operating system. For Windows, install 'Build Tools for Visual Studio'. For Linux, install 'build-essential' (e.g., `sudo apt-get install build-essential`). For macOS, install 'Xcode Command Line Tools' (`xcode-select --install`). After installing, try `pip install moocore` again. Alternatively, install a pre-compiled wheel if available for your system and Python version.
AttributeError: module 'moocore' has no attribute 'calculate_hypervolume'
You are trying to call a function or access an attribute named 'calculate_hypervolume' that does not exist in the 'moocore' module, or the name is misspelled. The actual function for hypervolume calculation in moocore is `hypervolume`.
fix
Consult the `moocore` documentation or use `dir(moocore)` in a Python interpreter to find the correct attribute or function name. The correct function for hypervolume is likely `moocore.hypervolume()` or a method on a specific class within `moocore`.
ValueError: operands could not be broadcast together with shapes (X) (Y)
This error typically occurs when providing input arrays (e.g., NumPy arrays) with incompatible shapes or dimensions to a `moocore` function, preventing mathematical operations like broadcasting from being performed correctly. Many multi-objective optimization algorithms expect specific input array structures, such as 2D arrays where rows are points and columns are objectives.
fix
Review the documentation for the specific `moocore` function you are using to understand its expected input array shapes and dimensions. Ensure your input data (e.g., objective values, reference points) conforms to these requirements, often involving reshaping NumPy arrays (e.g., using `.reshape(-1, num_objectives)` or ensuring correct initial array creation).
Upgrade
Version history
0.3.1latest on PyPI · released May 4, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or newer.
numpyoptionalCommonly used for array manipulation in examples and for data input/output, though not a hard dependency for the moocore package itself.
Agent activity
4 hits · last 30 days
node
4
Resources
moocore — pip install moocore · libregistry