COMSOC-Community / prefsampling

A small package providing many algorithms to sample preferences
https://comsoc-community.github.io/prefsampling/
GNU General Public License v3.0
2 stars 1 forks source link

EuclideanSpace question #2

Closed epacuit closed 4 months ago

epacuit commented 6 months ago

Hi Simon,

We have integrated prefsampling with our pref_voting package, but I'm getting an error that I can't quite figure out how to solve.

When I try to import EuclideanSpace from prefsampling.core.euclidean, I am getting an error:

from prefsampling.core.euclidean import EuclideanSpace

ImportError: cannot import name 'EuclideanSpace' from 'prefsampling.core.euclidean' (/Users/epacuit/Dropbox/code/voting-scripts/pref_voting/.venv/lib/python3.11/site-packages/prefsampling/core/euclidean.py)

However, looking at the documentation and the code it seems that EuclideanSpace is there.

Is there a standard way to refer to a "uniform", "ball", "guassian", and "sphere" point sampler, or do I need to define the relevant point_sample function?

Simon-Rey commented 6 months ago

Hey Eric,

Yes sorry it's still unstable (particularly the Euclidean models). I'm in the process of refactoring the code after some feedback I've received. The docs is not in line with what is on pip. I'll ping you once I'm done :)

Sorry for that.

Simon.

epacuit commented 6 months ago

Sounds good, thanks!

Simon-Rey commented 6 months ago

Ok I've now pushed the new version to pip, everything is back. You can have a look there: https://comsoc-community.github.io/prefsampling/reference/ordinal/euclidean.html#prefsampling.ordinal.euclidean.euclidean, there are now examples included. :)

By the way, I believe that you have several samplers in pref_voting that we do not have, would you want to integrate them here? (I can do at some point in the future)

Simon-Rey commented 4 months ago

Hi Eric, I'm using this to warn you that I have now changed the type of the ordinal samplers so that they return list of list instead of numpy arrays. This gives us the flexibility of including ties and incomplete rankings. It probably does not change anything for you, but in case you could check ;) Sorry for that.