SebastianM-C / PkgCite.jl

Cite Julia packages in your papers the easy way
MIT License
82 stars 7 forks source link

Features #1

Open SebastianM-C opened 3 years ago

SebastianM-C commented 3 years ago
ChrisRackauckas commented 3 years ago

Chris Rackauckas 9:27 AM We need a library where you can say get_citations(package) or get_citations(manifest) and it'll spit out the full bibtex for the dependency tree. :+1: 4

5 replies Last reply today at 3:37 PMView thread

Chris Rackauckas 9:27 AM And then generate_tool_citation(manifest) that spits out something like: (edited) 9:28

Text for the paper:

This work was done in Julia v1.6 and made use of the packages: DifferentialEquations.jl [cite], StochasticDiffEq.jl [cite], ... .

Extra Citation Details:

OrdinaryDiffEq.jl - Please use ?Tsit5 on the solver used to find the citation for the solver.

Bibtex:

@article{...}
@article{...}

(edited) :+1: 1

9:28 because I want to just copy paste that into the paper. 9:29 If that exists, and it reads from CITATION.bib, then I think more people would be inclined to add a CITATION.bib

Datseris commented 3 years ago

Why make this a separate package instead of a function in DrWatson?

ChrisRackauckas commented 3 years ago

Why would a single function thing go into DrWatson? This should go into Base Julia or Pkg if anything.

Datseris commented 3 years ago

sure, base julia is even better.

Why would a single function thing go into DrWatson?

So that it is more discoverable, and very clearly fits what the package aims to do.

Datseris commented 3 years ago

Also, don't really get your argument... "Single function"? DrWatson has many "single functions". Most of it is single functions actually.

ChrisRackauckas commented 3 years ago

So that it is more discoverable, and very clearly fits what the package aims to do.

But if you look at https://juliadynamics.github.io/DrWatson.jl/dev/workflow/, it has nothing to do with steps 1, 2, 3, 4, 5, or 6 of DrWatson.jl. The purpose is literally just to make CITATION.bib the standard for citing in Julia, and give you a function so that you can grab the bibtex of all dependencies. You don't need any of DrWatson.jl's init_project, quickactivate, dict_list, etc. to do that, so why would DrWatson.jl even be involved? It's so nonsensical to me that I'm really confused why it's even coming up. Not a single function in that repo has relevance.

(Note I'm not against DrWatson or anything, it's great for cataloging simulation workflow projects, but I just really don't see any connection.)

Datseris commented 3 years ago

It's fine, we just see this differently. Given that the opening sentence says: "DrWatson is a scientific project assistant software. It helps people manage their scientific projects (or any project for that matter)." then I would find it reasonable that the software I use to manage my scientific project and paper code base also provides a way to put the references of said software to my paper.

If any, my goal was to only help discoverability. But as I said, I would also prefer to see this in Base rather than anywhere else.

SebastianM-C commented 3 years ago

I was thinking that this package could be a dependency of DrWatson, but I wasn't sure if there are any needs from DrWatson, so that's why I asked. I think that this bit of code can exist independently of DrWatson the same way Bibliography.jl (which parses .bib files) is independent of this package.

SebastianM-C commented 3 years ago

Regarding the above discussion about the inclusion of this functionality in Base / Pkg, I don't think that can happen for the following reasons: Inclusion of something like this is out of the question since the functionality heavily depends on Pkg; For the inclusion in Pkg, the issue is that generating the human readable string requires the citations keys and thus a .bib parser (which is done by Bibliography.jl in the package).

Regarding the

Extra Citation Details:

part mentioned by @ChrisRackauckas, I think that it could be implemented through a 0 dependency package (different form this one, obviously) that would define a alg_citation function overloadable by packages and a has_extra_citations function that packages could use to transmit to Cite.jl that they might have extra citations. I'd like to get more feedback about this feature and its possible implementation.

Now that #4 is merged, I think that the initial ideas suggested by @ChrisRackauckas are implemented and it would make sense to register the package. If there are no objections to this, I will register the package in the following days and also announce it on Discourse to get more feedback from the community.

Datseris commented 3 years ago

I may have misunderstood something: why do you need a .bib parser library? Initially I thought that you would collect all CITATION.bib files from all dependencies and concatenate them in a single file? (removing duplicate strings of course)

SebastianM-C commented 3 years ago

It depends on what features you would like in the end, but @ChrisRackauckas mentioned that it would be nice for the package to give you a sentence that you can just copy-paste. For that, we need the parser to get the cite keys.

ChrisRackauckas commented 3 years ago

Just tested it:

This work was done in \cite[Julia v1.6.1]{Julia-2017} and made use of the following packages: LightGraphs.jl\cite[LightGraphs]{Bromberger17}, VertexSafeGraphs.jl\cite[VertexSafeGraphs]{VertexSafeGraphs.jl}, BenchmarkTools.jl\cite[BenchmarkTools]{BenchmarkTools.jl-2016}, Optim.jl\cite[Optim]{Optim.jl-2018}, MuladdMacro.jl\cite[MuladdMacro]{DifferentialEquations.jl-2017}, LabelledArrays.jl\cite[LabelledArrays]{DifferentialEquations.jl-2017}, Catalyst.jl\cite[Catalyst]{DifferentialEquations.jl-2017}, ExponentialUtilities.jl\cite[ExponentialUtilities]{DifferentialEquations.jl-2017}, DiffEqJump.jl\cite[DiffEqJump]{DifferentialEquations.jl-2017}, OrdinaryDiffEq.jl\cite[OrdinaryDiffEq]{DifferentialEquations.jl-2017}, ModelingToolkit.jl\cite[ModelingToolkit]{ma2021modelingtoolkit,DifferentialEquations.jl-2017}, ArrayInterface.jl\cite[ArrayInterface]{DifferentialEquations.jl-2017}, AbstractAlgebra.jl\cite[AbstractAlgebra]{AbstractAlgebra.jl-2017}, QuadGK.jl\cite[QuadGK]{quadgk}, Zygote.jl\cite[Zygote]{Zygote.jl-2018}, Quadrature.jl\cite[Quadrature]{DifferentialEquations.jl-2017}, RecursiveArrayTools.jl\cite[RecursiveArrayTools]{DifferentialEquations.jl-2017}, DiffEqBase.jl\cite[DiffEqBase]{DifferentialEquations.jl-2017} and FFTW.jl\cite[FFTW]{FFTW.jl-2005}.

@misc{Bromberger17,
 doi           = {10.5281/zenodo.889971},
 author        = {Seth Bromberger, James  Fairbanks and contributors},
 year          = {2017},
 url           = {https://doi.org/10.5281/zenodo.889971},
 title         = {JuliaGraphs/LightGraphs.jl: an optimized graphs package for the Julia programming language}
}

@misc{VertexSafeGraphs.jl,
 howpublished  = {\url{https://github.com/matbesancon/VertexSafeGraphs.jl}},
 author        = {Besançon, Mathieu},
 version       = {v0.1.0},
 year          = {2019},
 month         = {5},
 title         = {{VertexSafeGraphs.jl}}
}

@misc{BenchmarkTools.jl-2016,
 author        = {{Chen}, Jiahao and {Revels}, Jarrett},
 adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
 month         = {Aug},
 journal       = {arXiv e-prints},
 title         = {{Robust benchmarking in noisy environments}},
 eid           = {arXiv:1608.04295},
 keywords      = {Computer Science - Performance, 68N30, B.8.1, D.2.5},
 primaryclass  = {cs.PF},
 archiveprefix = {arXiv},
 eprint        = {1608.04295},
 year          = {2016},
 url           = {https://arxiv.org/abs/1608.04295},
 adsurl        = {https://ui.adsabs.harvard.edu/abs/2016arXiv160804295C}
}

@article{Optim.jl-2018,
 number        = {24},
 pages         = {615},
 doi           = {10.21105/joss.00615},
 author        = {Mogensen, Patrick  Kofod and Riseth, Asbj{\o}rn  Nilsen},
 year          = {2018},
 volume        = {3},
 journal       = {Journal of Open Source Software},
 title         = {Optim: A mathematical optimization package for {Julia}}
}

@article{DifferentialEquations.jl-2017,
 author        = {Rackauckas, Christopher and Nie, Qing},
 journal       = {The Journal of Open Research Software},
 title         = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
 number        = {1},
 doi           = {10.5334/jors.151},
 keywords      = {Applied Mathematics},
 note          = {Exported from https://app.dimensions.ai on 2019/05/05},
 year          = {2017},
 url           = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
 volume        = {5}
}

@article{Julia-2017,
 pages         = {65--98},
 author        = {Bezanson, Jeff and Edelman, Alan and Karpinski, Stefan and Shah, Viral  B},
 journal       = {SIAM {R}eview},
 title         = {Julia: A fresh approach to numerical computing},
 publisher     = {SIAM},
 number        = {1},
 doi           = {10.1137/141000671},
 year          = {2017},
 url           = {https://epubs.siam.org/doi/10.1137/141000671},
 volume        = {59}
}

@misc{ma2021modelingtoolkit,
 author        = {Ma, Yingbo and Gowda, Shashi and Anantharaman, Ranjan and Laughman, Chris and Shah, Viral and Rackauckas, Chris},
 archiveprefix = {arXiv},
 primaryclass  = {cs.MS},
 eprint        = {2103.05244},
 year          = {2021},
 url           = {https://arxiv.org/abs/2103.05244},
 title         = {ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling}
}

@inproceedings{AbstractAlgebra.jl-2017,
 pages         = {157--164},
 booktitle     = {Proceedings of the 2017 ACM on International Symposium on Symbolic and Algebraic Computation},
 author        = {Fieker, Claus and Hart, William and Hofmann, Tommy and Johansson, Fredrik},
 title         = {Nemo/Hecke: Computer Algebra and Number Theory Packages for the Julia Programming Language},
 publisher     = {ACM},
 doi           = {10.1145/3087604.3087611},
 address       = {New York, NY, USA},
 series        = {ISSAC '17},
 year          = {2017},
 url           = {https://doi.acm.org/10.1145/3087604.3087611},
 numpages      = {8}
}

@misc{quadgk,
 howpublished  = {\url{https://github.com/JuliaMath/QuadGK.jl}},
 author        = {Johnson, Steven  G.},
 title         = {{QuadGK.jl}: {G}auss--{K}ronrod integration in {J}ulia}
}

@misc{Zygote.jl-2018,
 author        = {Innes, Michael},
 bibsource     = {dblp computer science bibliography, https://dblp.org},
 journal       = {CoRR},
 title         = {Don't Unroll Adjoint: Differentiating SSA-Form Programs},
 biburl        = {https://dblp.org/rec/bib/journals/corr/abs-1810-07951},
 eprint        = {1810.07951},
 archiveprefix = {arXiv},
 year          = {2018},
 url           = {https://arxiv.org/abs/1810.07951},
 volume        = {abs/1810.07951},
 timestamp     = {Tue, 30 Oct 2018 20:39:56 +0100}
}

@article{FFTW.jl-2005,
 number        = {2},
 pages         = {216--231},
 doi           = {10.1109/JPROC.2004.840301},
 author        = {Frigo, Matteo and Johnson, Steven~G.},
 note          = {Special issue on ``Program Generation, Optimization, and Platform Adaptation''},
 year          = {2005},
 volume        = {93},
 journal       = {Proceedings of the IEEE},
 title         = {The Design and Implementation of {FFTW3}}
}

That's golden! Thanks a lot @SebastianM-C . I think should get registered and a PSA on the CITATION.bib standard should be sent to Discourse. @viralbshah anything you'd add?

davibarreira commented 3 years ago

I'm reading the source code for the package, and if I understand it correctly, you get the CITATION.bib directly from the local files in the computer of the user, based on the path given by the deps. How do you intend to implement the scraping from tags such as Zenodo? The package I'm working (OptimalTransport.jl) has a Zenodo tag, so I'd like to help you out with the implementation of this feature. What I mean is, for example, are you thinking of adding HTTP.jl or Gumba.jl as dependencies?

SebastianM-C commented 3 years ago

@davibarreira I was thinking of parsing the READMEs of the packages to look for a Zenodo tag and then use HTTP.jl to access the Zenodo API and construct the Bibliography.jl entry (so that it can then easily be merged with the rest). I'm not sure if web scraping would be a better option. I created #9 to track this.