Giter Club home page Giter Club logo

Comments (7)

raehik avatar raehik commented on July 22, 2024

Wonder if this can easily be made case-insensitive?

from rebench.

smarr avatar smarr commented on July 22, 2024

My reading of https://python.readthedocs.io/en/latest/library/importlib.html and https://peps.python.org/pep-0235/ is that Python is a case-sensitive language, and I didn't see any option to use case insensitive semantics for the import.

So, I fear that's a documentation bug. 🙁

from rebench.

raehik avatar raehik commented on July 22, 2024

Hmm. I imagine it could be done with some string checking machinery, a masterlist of strings to gauge formats (instead of importing dynamically). Is that worthwhile, or should I amend the docs and add a help message for when Python gets an invalid gauge adapter?

from rebench.

smarr avatar smarr commented on July 22, 2024

Hm, right. We could intercept well known names, check them case insensitive, and map them to the corresponding and correctly cased name.

Perhaps there's even no need for the dynamic import.
The current model is designed to make it easy to just drop in a suitable file.
But, in practice, none has a custom one.
It's also not really practical since if one would install ReBench via pip, one probably would want to have the gauge adapter somehow separate, possibly next to the benchmark config.

Give that rather suboptimal situation, we could try something like looking for gauge adapters on the disk, and then check case insensitively whether the names match, and use the file name we found on the disk for import.

from rebench.

smarr avatar smarr commented on July 22, 2024

And, yeah, one could possibly indeed drop the dynamic import altogether until someone actually asks for it.

from rebench.

raehik avatar raehik commented on July 22, 2024

It wasn't immediately apparent how to make gauge adapter resolution case insensitive (it's done by attempting to import packages until one hits, not comparing strings/filenames), so I amended some docs and added a more useful error message on failure in #200 .

from rebench.

smarr avatar smarr commented on July 22, 2024

Now implemented as case-insensitive with #202.

from rebench.

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.