OpenMined / PySyft

Perform data science on data that remains in someone else's server
https://www.openmined.org/
Apache License 2.0
9.54k stars 1.99k forks source link

Audit differential-privacy tutorial #5428

Closed jmaunon closed 3 years ago

jmaunon commented 3 years ago

Context

docs_team is trying to push some good practices about documentation (inline docstring, tutorials, examples and Readmes)

one of the tasks that is not done is to check tutorials in order to know what of them work without problem and what of them need to be updated.

Output

The output of this issue is just the status:

This is a great oportunity to get involved into pysyft!

hellomynameisjiji commented 3 years ago

Hi! I'd like to work on this issue as a part of applying to GSoC!

hellomynameisjiji commented 3 years ago
  1. pydp

    • PyDP_Syft_Data_Owner.ipynb: Bad

      PyDP_Syft_Data_Scientist.ipynb : Bad

      • duet.requests.add_handler()
        • It has a TypeError for the argument 'name'.
        • I tried to comment out the name argument, and it worked well.
      duet.requests.add_handler(
          name="private_mean",
          action="accept",
          print_local=True
      )
      duet.requests.handlers
      ---------------------------------------------------------------------------
      TypeError                                 Traceback (most recent call last)
      <ipython-input-24-e5c48006c244> in <module>
      ----> 1 duet.requests.add_handler(
            2     name="private_mean",
            3     action="accept",
            4     print_local=True
            5 )
      
      TypeError: add_handler() got an unexpected keyword argument 'name'
      • I found that the name argument was deleted as it had an overlapped usage with the tag (See the issue: https://github.com/OpenMined/PySyft/issues/5102).

        So, now the name argument does not exist anymore in the method.

        syft.core.node.domain.client.add_handler()
        def add_handler(
                self,
                action: str,
                print_local: bool = False,
                log_local: bool = False,
                tags: Optional[List[str]] = None,
                timeout_secs: int = -1,
                element_quota: Optional[int] = None,
            ) -> None:
                handler_opts = self._validate_options(
                    id=UID(),
                    action=action,
                    print_local=print_local,
                    log_local=log_local,
                    tags=tags,
                    timeout_secs=timeout_secs,
                    element_quota=element_quota,
                )
        
                self._update_handler(handler_opts, keep=True)
      • I may delete the name argument from the tutorials or include the name argument in add_handler().

      • In my PR, I'll take the second option since the argument seems to be needed.

  2. opacus

    • Opacus_Syft_Data_Owner.ipynb: Good
    • Opacus_Syft_Data_Scientist.ipynb: Good
blackcymbal commented 3 years ago

I will be glad to contribute.