gtojty / pyemread

package for creating bitmaps, region files, and analyzing ascii eye-movement data
2 stars 1 forks source link

__init__.py note #2

Open davebraze opened 8 years ago

davebraze commented 8 years ago

See https://github.com/tmalsburg/EyeScript/blob/master/EyeScript/__init__.py for guidance on handling 'import' of functions to be made externally available from package.

davebraze commented 8 years ago

Also look into proper use of all declaration in init.py to control name exports.

davebraze commented 8 years ago

Maybe a reasonable way to tackle re-export of imported packages would be to prepend namespaces with underscores. Instead of

import numpy as np

do

import numpy as _np
gtojty commented 8 years ago

this is resolved now. (change np as _np, so do the other packages with alias)

davebraze commented 8 years ago

Have you checked to be sure it works? Are packages imported within pyemread still re-exported, or not?

gtojty commented 8 years ago

it is working.

davebraze commented 8 years ago

It turns out that while your changes here https://github.com/gtojty/pyemread/commit/b630a360b4d3a451e2d76259a6881f6106330f3d handle the cases of pandas, numpy, and matplotlib, there are still a number of packages imported into the pyemread that are being re-exported.

Let's leave it as-is for now, but we'll want to revisit this eventually.

gtojty commented 8 years ago

I now modified the code such that all imported packages were given different names (some are added "_" before).