Giter Club home page Giter Club logo

Comments (5)

yarikoptic avatar yarikoptic commented on July 22, 2024

at which point? if in collector -- probably not worth it... In the IO -- again not sure since we would need a custom structure from all the references based on desired output: e.g. currently nested hierarchy, but could be more flat (than such separation could be the natural way to re-present)

from duecredit.

mvdoc avatar mvdoc commented on July 22, 2024

so, atm we are storing the citations referenced by the entry key, but this is not optimal because we can have the same entry for different functions/modules/packages (see #30). I think we should refactor the Collector or the citations so that they are referenced according to the path and not to the entry key. What do you think?

EDIT: what I meant is that in DueCreditCollector we store everything referenced by the path, and we store a set of citations for each path

from duecredit.

yarikoptic avatar yarikoptic commented on July 22, 2024

you are 100% correct. indeed storing by entry key leads to collisions. But the same by path alone -- multiple citations per each path would collide. May be by a tuple (entry_key, path) then? ;) or citations could be a dict (by key) of dicts (by path). This way we could still quickly determine the correct citation, either it was hit before etc. May be the simplest just to make compound key (entry, path) and see how implementation holds and if you feel that dict of dicts would be better -- reimplement that way

from duecredit.

mvdoc avatar mvdoc commented on July 22, 2024

I was thinking of implementing __eq__ for the Citation class, so that we can use sets on those, and store for each path key a set of citations, so we automatically avoid any duplicate. But a tuple as key seems good to me too.

from duecredit.

yarikoptic avatar yarikoptic commented on July 22, 2024

On Fri, 31 Jul 2015, Matteo Visconti di Oleggio Castello wrote:

I was thinking of implementing eq for the Citation class, so that we
can use sets on those, and store for each path key a set of citations, so
we automatically avoid any duplicate. But a tuple as key seems good to me
too.

sets operate only on immutable hashable objects, so even with
eq I think that would not work. that immutable aspect might be the
one which would forbid us to make sets of them etc

Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist, Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik

from duecredit.

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.