os-climate / physrisk

Physical climate risk calculation engine
Apache License 2.0
24 stars 31 forks source link

how to import from the test folder #195

Open lotuslu999 opened 7 months ago

lotuslu999 commented 7 months ago

Hi developer,

I'm trying to import some classes and functions from under the test folder which is the one parallel to 'physrisk'. However, I came across the below failure. Could you advise what's the best way to do so please?

import from test folder error import from test folder

Best, Lotus

eharrison24 commented 7 months ago

@HeatherAck I'm seeing this bug request today (12/8), can you point me in the right direction?

Best, Evan

HeatherAck commented 7 months ago

Hi @eharrison24 - since this is specific to Physical Risk I am assigning/adding @joemoorhouse

joemoorhouse commented 6 months ago

Hi @lotuslu999,

I suspect probably the in-built test module prevents you from doing that.

If you are trying to install dependencies and run the tests please see the steps here: https://github.com/os-climate/physrisk/blob/main/CONTRIBUTING.md Generally developers would either run the tests using tox, or set up the IDE (e.g. VS Code / PyCharm) to discover the tests so you can debug through them. Personally I use VS Code.

I think you are trying to import like any other module and there the naming clash is causing problems. Actually we are renaming the folder 'tests' to be more standard (and avoid exactly that issue). This is alongside a few other reorganisations, hopefully pushing in the next couple of weeks.

Thanks, Joe