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

[WIP][DOC] introducing sphinxcontrib-Bibtex to improve reference management #2810

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

Conversation

skoudoro
Copy link
Member

@skoudoro skoudoro commented May 11, 2023

build succeeded, 1871 warnings.

A lot of those warning are due to references. This PR add sphinxcontrib-bibtex to manage references, avoid duplication, avoid formatting error, etc.

This PR will take a bit of time to be finalize so I wonder if I should split it in multiple PR or not. It should make review process easier. Looking forward for your feedback.

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Merging #2810 (381f4fe) into master (89e4ab6) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2810      +/-   ##
==========================================
+ Coverage   81.45%   81.47%   +0.01%     
==========================================
  Files         144      144              
  Lines       20054    20054              
  Branches     3192     3192              
==========================================
+ Hits        16335    16339       +4     
+ Misses       2909     2906       -3     
+ Partials      810      809       -1     
Impacted Files Coverage Δ
dipy/reconst/dki.py 94.49% <ø> (ø)

... and 1 file with indirect coverage changes

@arokem
Copy link
Contributor

arokem commented May 11, 2023

Splitting it up makes sense to me. There's no reason to wait until it's all done to merge these additions, right?

@skoudoro
Copy link
Member Author

There's no reason to wait until it's all done to merge these additions, right?

right, so you can merge, and I will do that step by step starting with the examples and then the docstring in the codebase

Copy link
Contributor

@arokem arokem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! What do you think about normalizing the bibtex keys?

r"""Compute apparent diffusion coefficient (adc).

Calculate the apparent diffusion coefficient (adc) in each direction of
a sphere for a single voxel :footcite:t:`NETOHENRIQUES201585`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of an eyesore. Maybe we could we use a uniform format for bibtex keys? For example, "NetoHenriques2015NeuroImage"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of an eyesore

ahahah, you are right

Maybe we could we use a uniform format for bibtex keys?

I agree, even if the bibtex file is big. I like the beginning of your example but I do not think we should finish with the journal. so just {firstname}{name}{year}{letter | optional if multiple paper} is that ok ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. That would work well.

Copy link
Contributor

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @skoudoro.

Not sure if sphinxcontrib-bibtex is actively maintained, but I do agree that this or other similar mechanism is required.

Some comments in-line.

@@ -319,14 +319,14 @@ @Article{Carlsson2009
}

@Article{Avram2008NMRBiomed,
Author = {Avram, Liat and \�{O} zarslan, Evren and Assaf, Yaniv
Author = {Avram, Liat and \�{O} zarslan, Evren and Assaf, Yaniv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This symbol and other similar ones introduced are not plain, BIbTeX symbols; e.g. the correct BibTeX spelling for Evren's surname would be \"{O}zarslan. I can have a go to the file to fix them. I assume the changes were done inadvertently introduced when running some tool.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can have a look at this and amend the commit.

and Bar-Shir, Amnon and Cohen, Yoram and Basser, Peter
J.},
Title = {Three-dimensional water diffusion in impermeable
cylindrical tubes: theory versus experiments},
Journal = {NMR IN BIOMEDICINE},
Volume = {21},
Pages = {888�898},
Pages = {888�898},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above, but in this case the hyphen does exist in BibTeX; usually BibTeX is smart enough to change it to the en dash for page ranges.

@jhlegarreta
Copy link
Contributor

I agree to the conversation in #2810 (comment). I am sure there is also a way to generate the keys automatically using a self-defined pattern, but we may leave that as a separate task/PR.

Also, making all entries consistent (fields, names, etc.) would ease reading the file (e.g. when maintainers need to go through it). Something that might be partially automated? Probably best as a separate PR.

@jhlegarreta
Copy link
Contributor

Also, If BibTeX references will be/are split across modules (e.g. segment, tracking, docs, etc.), it may be harder to maintain, as the same reference may fall into different categories, duplicated entries may exist (unless the automated tool prevents them, but then it may not be evident where a reference should belong to).

@skoudoro skoudoro force-pushed the master branch 7 times, most recently from 1419292 to ca6268a Compare December 8, 2023 22:25
@skoudoro skoudoro force-pushed the master branch 3 times, most recently from 5935e1e to 765963e Compare January 24, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants