Giter VIP home page Giter VIP logo

Comments (4)

leonlan avatar leonlan commented on August 21, 2024 1

OK, that we can do! Let's choose # as line comment syntax. Will you make a PR for this? This function needs to be modified to ignore the comments:

https://github.com/leonlan/VRPLIB/blob/c504de49176125fe523b6f2d931eac62eb0d2683/vrplib/parse/parse_utils.py#L4-L8

It takes the instance text as a string. Lines that are empty when stripped or lines that start with # should be ignored. All other lines are returned as a list.

from vrplib.

N-Wouda avatar N-Wouda commented on August 21, 2024

(I'd not mind implementing this, but I think it needs a bit of discussion first)

from vrplib.

leonlan avatar leonlan commented on August 21, 2024

I think this is useful to have, but we need to think a bit more about the comment syntax.
Ideally, we use something that minimizes the impact of this change and is also future-proof.

For the case where we only allow comments on distinct lines, we have a lot more freedom, since it's not expected that any data or specification line will start with ;, # or //. But when we also want to handle the case where we ignore everything after the comment line syntax, we have to deal with many more variations. I can imagine that some instances use ; or # in the COMMENT specification. One issue with // is that it is used in URLs: for example, a COMMENT specification may include an URL to the web page that is hosting the instance.

Could you maybe provide an example on how you would like to use comments in the PyVRP test instances? If it suffices to have comments only on separate lines, then I think we should implement // as comment line syntax. But if you think it'd be really useful to have comments on "data" lines as well, then we might need to think a bit more about the syntax. Maybe triple forward slashes ///?

from vrplib.

N-Wouda avatar N-Wouda commented on August 21, 2024

I think just line comments are fine, I don't really see a need for comments at the end of data lines. So something like "every line that starts with a ; is a comment" could work.

from vrplib.

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.