Closed cgranade closed 7 years ago
Looking good, Chris. Are you thinking of implementations=experimental, or having both? It would also be good to add something to the guide about how to use it.
Thanks! My thought was to have tags broken down into theory
and implementations
, with the latter being included by duecredit by default, but I really like your suggestion of experiment
as well to point to experimental applications. I'll start adding to the guide on how to use the new duecredit functionality soon, with the explicit note that the bibliography is not yet complete and that users should still be careful to cite as appropriate.
One weird bug so far: duecredit
injects "Frey, B.J. & Dueck, D., 2007. Clustering by Passing Messages Between Data Points. Science, 315(5814), pp.972–976." as a citation for a part of scikit-learn's clustering library, such that that citation shows up if the user has scikit-learn installed. I'm not sure quite what to do about that, since QInfer definitely does import sklearn.cluster
in clustering.py
.
Let me know when you satisfied with the state of this PR. I will test it on my machine, and subsequently provide a code review.
I think I'm mostly happy with this PR now, modulo that the process listed in the docs for generating a bibliography using the DUECREDIT_ENABLE="yes"
environment variable setting seems to not always work. I'm a bit confused as to exactly what's going on there, and it could well be upstream, but if you have any insight I'd greatly appreciate it. Thanks! ♥
Played around briefly, seems to be working. If I just import qinfer as qi
without anything else (whether using env variable or with python -m duecredit
), I end up with
[4] 2017-04-03 11:16:13,396 [WARNING] DueCredit internal failure while running <function _dump_collector_summary at 0x7fc3c2755aa0>: OSError(13, 'Permission denied'). Please report to developers at https://github.com/duecredit/duecredit/issues (utils.py:199)
Do you get this too?
I am also wondering about jupyter notebooks. It seems that you can get the current state of collection using:
import os
os.environ['DUECREDIT_ENABLE'] = 'yes'
import qinfer as qi
qi.due._dump_collector_summary()
Although from my usual use of qinfer (through notebooks, possibly with local modules) this seems convenient, I would hesitate to recommend people use hidden functions.
Thanks for looking at that! I didn't get that error, but rather intermittently got a UnicodeDecodeError
. I'll isolate a test case and file it as an issue with DueCredit as well.
Hmm, the test script
import qinfer as qi
m = qi.CoinModel()
prior = qi.UniformDistribution([[0,1]])
u = qi.SMCUpdater(m, 1000, prior)
u.resampler(m, u.particle_weights, u.particle_locations)
is not putting Lui and West in the list. Am I doing something wrong? Just running python -m duecredit test.py
.
The @dcite
annotation for the Liu–West resampler uses the ["theory"]
tag, which is disabled by default. Does the test script work with DUECREDIT_REPORT_TAGS=*
? Also, pursuant to the discussion above, it might be a good idea to just change theory
to implementation
anyway.
This WIP PR addresses #128 by adding citation metadata to
__init__.py
. This citation is guarded with the tag["implementation"]
, with the idea that citations to underlying theory could be added to individual functions with the["theory"]
tag.