Giter Club home page Giter Club logo

Comments (8)

woshilapin avatar woshilapin commented on May 24, 2024 1

The first one named parse_zip_read() takes a std::io::Read as input. And that is actually the reason why we started using the verb parse instead of read, to avoid something like read_zip_read(read: impl Read)

from transit_model.

woshilapin avatar woshilapin commented on May 24, 2024

I think that would be a very nice API ❤️. Note that this is only about the GTFS API, maybe something similar for NTFS and the rest of the public API.

from transit_model.

pbougue avatar pbougue commented on May 24, 2024

It's a nice API, yes.
Not sure that from_zip and from_path would be used a lot (except for forcing one) as the perf price to have both is low.

At first sight, I would put it in 'polish' category, so my question for working on it is: what is the expected gain on that?
A lot of people would use the lib to do some opensource PT-stuffs that we would consider reusable?
(I compare it with the yak-shaving part of changing all the error-handling that seems more valuable, but I'm absolutely not confident in my judgement/ideas on that).

from transit_model.

antoine-de avatar antoine-de commented on May 24, 2024

yes I agree the gain would be quite minimal, it can maybe bring some reusers and lower the step to use transit_model (even for CanalTP), but the time to implement this is also very limited so I guess so trade off is not bad.

For from_zip and from_path you're right they are only meant to be used if the default magic to call the right one is not ok for some specific use case.

from transit_model.

antoine-de avatar antoine-de commented on May 24, 2024

After discussion with @woshilapin:

  • parse_zip_read(read: impl Read, source_name: &str)
  • parse_zip_path(path: impl AsRef<Path>)
  • parse_dir_path(path: impl AsRef<Path>)
  • parse(path: impl AsRef<Path>)

from transit_model.

datanel avatar datanel commented on May 24, 2024

no parsing from reader?

from transit_model.

datanel avatar datanel commented on May 24, 2024

The first one named parse_zip_read() takes a std::io::Read as input. And that is actually the reason why we started using the verb parse instead of read, to avoid something like read_zip_read(read: impl Read)

what is source_name ?

from transit_model.

antoine-de avatar antoine-de commented on May 24, 2024

it's uggly but it's an artifact since the FileHandler needs a name for better errors.

from transit_model.

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.