Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Create Pybind wrappers for the Quantiles class

Aperta
#485 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, python
Ambito
api

Direzione di ricerca

Start with cc/algorithms/quantiles.h to compare the C++ Builder and public methods, then inspect pydp/src/bindings/PyDP/algorithms/qunatile_tree.cpp for PyDP binding conventions. Add pydp/src/bindings/PyDP/algorithms/quantiles.cpp for the double instantiation, status handling, and mechanism enum. Done means the listed methods are exposed and Build failures raise Python exceptions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Type: New Feature :heavy_plus_sign:

Create Pybind wrappers for the Quantiles class

Create Pybind11 wrappers for the differential_privacy::Quantiles. This will expose the functionality to the PyDP library.

Background:

The C++ Differential Privacy library includes a Quantiles class for calculating differentially private quantiles ( source). The PyDP library, which provides Python wrappers for the C++ library, already has bindings for the QuantileTree class ( Python differential pr...). To provide a more complete and user-friendly API, we should also create wrappers for the higher-level Quantiles class.

Implementation Details:

The new wrappers should be created in a new file, pydp/src/bindings/PyDP/algorithms/quantiles.cpp. The Python API should follow the existing conventions in PyDP and mirror the C++ API of the Quantiles class as closely as possible.

The Quantiles class is templated on arithmetic types (int, double, etc.). The Pybind wrappers should be instantiated for common numerical only for double.

Classes and Methods to Wrap:

  1. Quantiles.__init__: which calls Quantiles<double>::Builder. It should have all parameters as in Builder.

  2. Quantiles

The following public methods of the Quantiles class should be wrapped:

AddEntry(const T&)
Serialize() const
Merge(const Summary&)
GetQuantiles() const
Result()

Considerations:

  1. The Build() method returns an absl::StatusOr. The wrappers should handle the status and raise an exception on failure.

  2. The SetLaplaceMechanism method takes a std::unique_ptr. For Python binding let's use enum - Laplace, Gaussian.

Lingua principale
Python
Stelle
550
Fork
143
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenMined/PyDP

Tutte le issue di OpenMined/PyDP

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.