Git Product home page Git Product logo

Comments (5)

rbavery avatar rbavery commented on May 28, 2024 1

Thanks @guidorice it looks like your fix is working, just tested it

from radiant-mlhub.

guidorice avatar guidorice commented on May 28, 2024

I thought of a simple fix for this, which is to add a new environment variable to our GitHub action for CI runner. Call it MLHUB_CI. The hilighted code in the description would then become:

        if 'PYTEST_CURRENT_TEST' in os.environ and 'MLHUB_CI' in os.environ:
            ...

This should free up the pytest context to work normally for users of radiant_mlhub. Does this sound OK @kbgg @mirob9363 ?

from radiant-mlhub.

guidorice avatar guidorice commented on May 28, 2024

Re: the underlying issue with vcr.py and multithreading, there are a bunch of related github issues, but these comments seem pretty relevant, from a former maintainer:

but this is the one area of code I would say I am probably still the resident expert in, and I really don't think that vcrpy is EVER going to be multi threaded (at least with its current design). kevin1024/vcrpy#212 (comment)

from radiant-mlhub.

rbavery avatar rbavery commented on May 28, 2024

@guidorice thanks for taking a look at this! Does the above comment indicate that it is just not a good idea to run catalog_downloader.py within a pytest environment?

from radiant-mlhub.

guidorice avatar guidorice commented on May 28, 2024

@rbavery I believe your use case should be fine (unless you are using vcr.py in your own code). Here is a feature branch, would you be able to test it out by installing it manually?

https://github.com/radiantearth/radiant-mlhub/tree/Fix/148-pytest-compatibility

I put together a little test and it seems to work for me by running pytest:

from radiant_mlhub import Dataset
from pathlib import Path


def test_mlhub_and_pytest():
    ds = Dataset.fetch('su_sar_moisture_content_main')
    ds.download()
    path = Path.cwd() / 'su_sar_moisture_content_main'
    csv_files = list(path.glob('**/*.csv'))
    assert len(csv_files) == 2616

from radiant-mlhub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.