Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:groupby: for sphinx bib directives + improvement of __doc__ #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yarikoptic
Copy link
Collaborator

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

All bib directives now should accept :groupby: option to group present entries. e.g.

    .. bibmatching:: example.bib
        :style: demo
        :filter:
           author: \bTheGod\b
           howpublished: \b(Talk|Poster)\b
        :groupby: entry_type, subtype, year
        :sort:

Should group all the entries first by entry_type (e.g. articles vs inbook),
subtype (custom field I introduced to categorize e.g. between talks and posters
in 'misc'), and year (here needs more work to provide reverse sorting, but
works otherwise)
@yarikoptic
Copy link
Collaborator Author

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

@matthew-brett
Copy link
Owner

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

@yarikoptic
Copy link
Collaborator Author

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

@matthew-brett
Copy link
Owner

Back on the 24th I hope...

@matthew-brett
Copy link
Owner

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.

otherwise it would fail to work on any bib file with a @comment
@matthew-brett
Copy link
Owner

Yarik - any comments on my review?

@yarikoptic
Copy link
Collaborator Author

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.

Sam Nastase and others added 2 commits July 9, 2014 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants