{"id":6721,"library":"moocore","title":"moocore","description":"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.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://github.com/multi-objective/moocore/","tags":["multi-objective optimization","optimization","algorithms","evolutionary computation","hypervolume","empirical attainment function"],"install":[{"cmd":"pip install moocore","lang":"bash","label":"Install latest PyPI version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"Commonly used for array manipulation in examples and for data input/output, though not a hard dependency for the moocore package itself.","package":"numpy","optional":true}],"imports":[{"symbol":"moocore","correct":"import moocore"},{"symbol":"filter_dominated","correct":"import moocore\npoints = moocore.filter_dominated(data)"},{"symbol":"Hypervolume","correct":"import moocore\nhv_calculator = moocore.Hypervolume(reference=ref_point)"}],"quickstart":{"code":"import numpy as np\nimport moocore\n\n# Example data: a set of 2D points (assuming minimization)\n# Each row is a point, each column is an objective\ndata = np.array([\n    [1.0, 5.0],\n    [2.0, 3.0],\n    [3.0, 2.0],\n    [4.0, 1.0],\n    [2.5, 2.5],\n    [1.5, 4.0]\n])\n\n# 1. Identify non-dominated points\nnondominated_points_mask = moocore.is_nondominated(data)\nnondominated_set = data[nondominated_points_mask]\nprint(f\"Non-dominated points:\\n{nondominated_set}\")\n\n# 2. Filter dominated points (returns only non-dominated ones)\nfiltered_set = moocore.filter_dominated(data)\nprint(f\"Filtered (non-dominated) set:\\n{filtered_set}\")\n\n# 3. Calculate Hypervolume (requires a reference point)\n# Reference point should be worse than all points in the objective space\n# For minimization, this means typically larger values.\nref_point = np.array([5.0, 5.0]) # Example reference point\n\nhv_calculator = moocore.Hypervolume(reference=ref_point)\nhypervolume_value = hv_calculator(filtered_set)\nprint(f\"Hypervolume of the non-dominated set: {hypervolume_value}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"Performance 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"C-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.","severity":"breaking","affected_versions":"<=0.2.0 (potentially earlier development versions)"},{"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`).","message":"Implicit 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Lack 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.","severity":"gotcha","affected_versions":"From 0.1.x to 0.2.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}