saltudelft / dl-type-python

Deep Learning-based type inference for Python
GNU General Public License v3.0
7 stars 4 forks source link

Visible Import Types retrieval #1

Closed elatoskinas closed 3 years ago

elatoskinas commented 4 years ago

Visible Type Extraction

Continuation of https://github.com/mir-am/ML4SE/pull/3 Resolves: https://github.com/mir-am/ML4SE/issues/2

Adds a file that allows to do the following:

Changes from original PR

Usage & Integration

The type extractor is not yet integrated into the pipeline. Integration is straight forward:

  1. Suppose we have an input file (path) file
  2. Create a new ModuleExtractor
  3. Call ModuleExtractor.getTypes(file)
  4. The returned result is a set of types. We can then keep it as a set, or convert it to a list. This is our final result output.
elatoskinas commented 4 years ago

@mir-am The implemented extractor is in module_type_extractor.py. All other files are there solely for testing purposes, and we will remove them once we finalize this PR.

mir-am commented 4 years ago

@elatoskinas Thanks for the work. Do you think that we can run the import tool for 5,000 Python projects? Considering the issues we discussed so far. Moreover, I will train the model of TypeWriter with the visible types that you sent.

elatoskinas commented 4 years ago

@mir-am Yes, we can certainly train it on 5000 repos; I'll get to this soon!

elatoskinas commented 3 years ago

Closing, moved to repo: https://github.com/saltudelft/visible-type-extractor