google-research / torchsde

Differentiable SDE solvers with GPU support and efficient sensitivity analysis.
Apache License 2.0
1.52k stars 195 forks source link

Commit "Mask out private packages." broke library import #3

Closed AdrienCorenflos closed 3 years ago

AdrienCorenflos commented 3 years ago

See this comment:

https://github.com/google-research/torchsde/commit/41fb567ae050ef6a178b452467ed64340c6cad16#r41181450

lxuechen commented 3 years ago

Hi,

I just tried installing the library via ssh from master, and this doesn't appear to be a problem. Could you provide more context?

As a side note, I understand that it could be confusing when different things have the same name. Though, the point I want to make is that import torchsde._core.sdeint as sdeint_module imports the module file sdeint.py, whereas from torchsde._core import sdeint as sdeint_module actually imports the function sdeint in that file. Here, we'd like to import the module file to use its function integrate.

Thanks, Chen

AdrienCorenflos commented 3 years ago

Hi,

If I simply do import torchsde, it fails with an error stating that there is no _core module.

I will provide a colab replication tomorrow first thing in the morning if that is not enough information.

Adrien

On Tue, 4 Aug 2020, 20:54 Xuechen Li, notifications@github.com wrote:

Hi,

I just tried installing the library via ssh from master, and this doesn't appear to be a problem. Could you provide more context?

Thanks, Chen

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google-research/torchsde/issues/3#issuecomment-668739290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYGFZ6S3HBRGF5RO5KYZEDR7BDOBANCNFSM4PUQFYVA .

lxuechen commented 3 years ago

Does this error still occur when installing the master branch? Thanks.

AdrienCorenflos commented 3 years ago

Can't say right now as I don't have access to a pc, but I did install from master on colab using pip install git+etc.

On Tue, 4 Aug 2020, 21:00 Xuechen Li, notifications@github.com wrote:

Does this error still occur when installing the master branch? Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google-research/torchsde/issues/3#issuecomment-668741952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYGFZ63X3QN7KABUO56AVLR7BEDTANCNFSM4PUQFYVA .

lxuechen commented 3 years ago

I just reproduced this on colab. I think it might have something to do with colab, since I'm not seeing this issue on my local machine or remote vm.

I'll get this fixed ASAP. Thanks again for the report!

For the time being, I'd recommend installing a previous version if the plan is just to play with the code, e.g.

!pip install git+http://git@github.com/google-research/torchsde@v0.1.1
lxuechen commented 3 years ago

Just debugged this and found it to only be an issue for Python <= 3.6. Here's the related bug fix discussion https://bugs.python.org/issue30024

Will send in a commit soon to fix it so that it also works with Python>=3 <=3.6.