Pysyft: Order pysyft

Created on 13 Dec 2017  路  5Comments  路  Source: OpenMined/PySyft

User Story

pysyft.py is currently hard to navigate. We should order it!

Discussion Points

Obvious route is alphabetic, ignoring __ and __i.
Inline functions after returning functions and __ixxx__ after __xxx__

We could also put the __xxx__ ops first. And make another exception for __init__.

Thoughts?

Most helpful comment

@Floev Good points!
Your navigation strategy sounds good to me. I'd categorize functions according to their job first (e.g. no_params_func is a different type of job than _add_ or _mul_), and then reorganize lexicographically as you mention. What do you think?

Also, regarding the exposure of those methods, I think we should do it, so that we are still consistent with PyTorch:
screen shot 2017-12-13 at 22 57 59

All 5 comments

Also, have we decided whether we want to expose the operators as functions as well?
E.g. def __add__ as well as def add

@Floev Good points!
Your navigation strategy sounds good to me. I'd categorize functions according to their job first (e.g. no_params_func is a different type of job than _add_ or _mul_), and then reorganize lexicographically as you mention. What do you think?

Also, regarding the exposure of those methods, I think we should do it, so that we are still consistent with PyTorch:
screen shot 2017-12-13 at 22 57 59

@floev I'd like this too. In my PR https://github.com/OpenMined/PySyft/pull/701 (closed now), I ordered lexicographical inside semantic sections. Does this make sense?

Edited

How do we feel about the current layout? The file was broken into pieces and seems certainly more organized before.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alberduris picture alberduris  路  3Comments

swaroopch picture swaroopch  路  4Comments

robert-wagner picture robert-wagner  路  4Comments

jvmncs picture jvmncs  路  3Comments

akirahirohito picture akirahirohito  路  3Comments