bibstuff icon indicating copy to clipboard operation
bibstuff copied to clipboard

:groupby: for sphinx bib directives + improvement of __doc__

Open yarikoptic opened this issue 11 years ago • 7 comments

This one does need some code polish and making it less ad-hoc but not sure if I would have time... seems to work though. It has potential to break things -- so would be nice if you could try/review.

But otherwise -- it should be very handy to automatically provide reasonably structured bibliographies. See e.g.

http://haxbylab.dartmouth.edu/publications.html

which was generated from a single bibmatching entry with groupby

yarikoptic avatar Jun 24 '13 18:06 yarikoptic

Hi @matthew-brett -- so what do you think about this PR?

yarikoptic avatar Jul 10 '13 16:07 yarikoptic

Oops - sorry - am more or less offline in Cuba. Can you get someone else to review? I will make sure you can merge...

matthew-brett avatar Jul 16 '13 20:07 matthew-brett

ok -- if there is any live expert in bibstuff ;)

when are you coming back to the hyber-land

On Tue, 16 Jul 2013, Matthew Brett wrote:

Oops - sorry - am more or less offline in Cuba. Can you get someone else

to review? I will make sure you can merge...

Yaroslav O. Halchenko, Ph.D. http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org Senior Research Associate, 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

yarikoptic avatar Jul 16 '13 21:07 yarikoptic

Back on the 24th I hope...

matthew-brett avatar Jul 16 '13 21:07 matthew-brett

Sorry - reviewing offline and pasting into the web form - forgive the clunkiness.

On a meta level - should we be abandoning this code and moving it to the sphinx-natbib extension instead?

bibref.py around line 98: I don't think you can get level symbols from the Sphinx or doctest API.

This is the definition of the section levels that Python uses, where the first value in the tuple is the character and the second value is whether the section heading has an overline as well as an underline::

STATE_SEQ = (
    ('#', True),
    ('*', True),
    ('=', False),
    ('-', False),
    ('^', False),
    ('"', False),
    ('#', True))

So: the second-from-top level heading uses "=" with no overline.

Around line 307 (_group_entries): so - everything has to be sorted alphabetically? So, 'Talk' must always come before 'Poster'?

Found this code hard to read - any chance of unpacking it into loops rather than list comprehensions?

Around line 351 'groupped' mis-spelled.

A little confused by the check if 'plural' is a number; how would that happen?

In format_citations - raise error for non-list immediately rather than at the end?

Can you think of any tests? I see that I didn't do a good job of that.

matthew-brett avatar Jul 17 '13 16:07 matthew-brett

Yarik - any comments on my review?

matthew-brett avatar Oct 01 '13 18:10 matthew-brett

Hi @matthew-brett sorry for not replying -- your review was so good and thorough that I have decided that I would need to allocate some quality time for bibstuff to react to it properly... and never got it yet :-/ worse to it -- it was working for our needs splendidly so I did not have additional motivator yet... may be some time later this week. sorry about the delay... or if you have a moment I would only appreciate if you give you TLC to this PR by addressing your concerns and recommendations.

yarikoptic avatar Oct 02 '13 02:10 yarikoptic