Giter Club home page Giter Club logo

Comments (2)

justinsalamon avatar justinsalamon commented on September 27, 2024

The reason every distribution tuple is validated when an event is added is that it can be different each time.

In your case you always add the same list of source files, but in general each time you add an event you could specify a different list of source files (or a different distribution tuple altogether) meaning we must validate the distribution tuple every time we call add_event.

I we don't validate the source files when an event is added it could cause Scaper to crash downstream. So from a design standpoint I believe what we are doing is the correct thing to do.

We could, potentially, add a flag to add_event to disable source file validation (e.g. disable_source_file_validation=False by default), since this is the only validation that involves file I/O - I believe all the other validation steps are insignificant computationally.

@moabaom To help us better understand how serious an issue this is, can you share a Minimal Working Example (MWE) and report the execution time with and without source file validation? Thanks!

from scaper.

justinsalamon avatar justinsalamon commented on September 27, 2024

p.s - actually another option would be to create a "cache" for validated files, such that if a scaper object has already validated that a file exists, it doesn't try to validate it again. This is probably safer than disabling validation and achieves the same speedup. If you create a new scaper object in a loop (like in the example), we could support providing a list of validated files as input, and the scaper object will not try to validate these source files.

Still, let's start with the MWE and timings to better scope the problem. thanks.

from scaper.

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.