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

Proposal: Improving the package #45

Closed
6 of 14 tasks
dieghernan opened this issue Dec 5, 2021 · 6 comments
Closed
6 of 14 tasks

Proposal: Improving the package #45

dieghernan opened this issue Dec 5, 2021 · 6 comments

Comments

@dieghernan
Copy link
Member

dieghernan commented Dec 5, 2021

Hi

Following #28 find here a proposed roadmap for improving the package. This is to be discussed:

Phase 1: Current state

Add test ideally based in snapshot (testthat >= 3):

Tests

  • Move to testthat > = 3
  • Improve current testing, including test for checking already closed issues.
  • Add separated test for advanced features on bibtex (crossref, use of STRING)

Phase 2: Alternative solution

  • Implement and Test alternative solution on separate branch

Phase 3: Agree on changes

  • Decide whether the changes should be applied, iterate
  • Check reverse dependencies {revdep}
  • Merge on main
  • Bump to a major version
  • CRAN release

Nice to have

Happy to get feedback on this

@dieghernan
Copy link
Member Author

dieghernan commented Dec 5, 2021

@coatless
Copy link
Collaborator

coatless commented Dec 6, 2021

@dieghernan I think one huge component that is missing from Phase 2 is addressing the underlying memory leaks. Or is this what "alternative solutions" means?

I should note that work was initially started by @matthewwiese in #40.

@matthewwiese
Copy link

I did start work on fixing the rchk warnings some months back and made good progress, although I never updated the PR because I wasn’t able to eliminate possible protection stack imbalance completely. A lot of the warnings in #33 can be mitigated by avoiding UNPROTECT_PTR(s) in favor of respecting the stack via UNPROTECT(n), in exchange for slightly more verbose logic in the grammar section and elsewhere. Despite these improvements, protection stack imbalance warnings would persist. My initial hunch was that it was merely a false positive and that rchk was getting "confused" by the generated parser - from rchk USAGE:

There are still some false alarms and bailouts for code that is still too complicated, and indeed there are not-useful reports for functions that have protection stack imbalance by design.

However, my changes still didn’t solve problems like #42, which suggests something more fundamental. I can update the PR with what I have if it'll be of benefit, but unfortunately I don't have the time to devote the proper attention to this.

I agree that any project to improve the package is moot unless the memory bugs are addressed.

@dieghernan
Copy link
Member Author

Thanks both for your comments. For clarity, what I am talking about in Phase 2 is to rewrite the package using base R rather to fix the current one, i.e. dropping the C code.

This is kind of risky, so it is important to have a full battery of tests covering the most extreme cases.

I am aware that Phase 2 may not be satisfactory, but even in the case you decide not to adopt it (it would be fine for me) I think it is worth to try

@matthewwiese
Copy link

For what it's worth, I think rewriting in R is a good idea. It eases future maintenance and allows existing users of the package to keep on working with only a minor performance penalty. If for some reason the parsing of BibTeX files is a bottleneck, one could always switch to rbibutils which appears to roll a hand-written C parser.

I don't know whether you're a student @dieghernan, but this could make for a great GSoC project if @coatless is up for it.

coatless pushed a commit that referenced this issue Jan 13, 2022
* Upgrade testing suite to testthat 3

* Add testing for previous issues

#45

* Add tests for standard bibtex entries

As defined in BibTEX version 0.99b
https://ctan.javinator9889.com/biblio/bibtex/base/btxdoc.pdf

* Update actions

* Add testing for examples

* Add snapshots for examples read.bib This may fail on some platforms

* Skip on non windows

Possibly a character problem related with
#20 and
#43

* Not test on R 3.4

Some changes in default  parsing (snapshot), but results are still ok

* Add more tests

* Try to increase coverage

* One more tests for do_read_bib

* Fix test for do_read_bib

* Revert actions

* Add devtools for testing

* Add more tests

* Add test for multiline string

* Add non standard field names

* Add myself as author

* Move issues to inst/bib files

* Refactor tests for avoiding cluttering
coatless added a commit that referenced this issue Sep 23, 2022
* Upgrade testing suite to testthat 3

* Add testing for previous issues

#45

* Add tests for standard bibtex entries

As defined in BibTEX version 0.99b
https://ctan.javinator9889.com/biblio/bibtex/base/btxdoc.pdf

* Update actions

* Add testing for examples

* Add snapshots for examples read.bib This may fail on some platforms

* Skip on non windows

Possibly a character problem related with
#20 and
#43

* Not test on R 3.4

Some changes in default  parsing (snapshot), but results are still ok

* Add more tests

* Try to increase coverage

* One more tests for do_read_bib

* Fix test for do_read_bib

* Revert actions

* Add devtools for testing

* Add more tests

* Add test for multiline string

* Add non standard field names

* Add myself as author

* Move issues to inst/bib files

* Refactor tests for avoiding cluttering

* Modify do_read_bib()

Also bump version

* Remove C code :)

* Recreate snapshots on Linux

* Check reverse dependencies

* Add backports

* Deprecate arguments

* Use seq_along

Co-authored-by: James J Balamuta <coatless@users.noreply.github.com>

* Use seq_along again

Co-authored-by: James J Balamuta <coatless@users.noreply.github.com>

* Remove completely header and footer

* Document internal functions

* Rename internal params

* Use vapply and new tests

* Rerun revdeps

* Update docs and snapshots

* Update revdep and check action

Some snapshots changes due to changes on toBibTex() on later versions of R, not related with the package

* Fix action and snapshots

Co-authored-by: James J Balamuta <coatless@users.noreply.github.com>
@coatless
Copy link
Collaborator

Closed as #47 is now in and the package is back on CRAN.

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

No branches or pull requests

3 participants