Skip to content

MAX_SQL_ITEMS as class variable#1016

Merged
dwhswenson merged 3 commits into
openpathsampling:masterfrom
dwhswenson:simstore-gyorgy-Apr2021
Jun 5, 2021
Merged

MAX_SQL_ITEMS as class variable#1016
dwhswenson merged 3 commits into
openpathsampling:masterfrom
dwhswenson:simstore-gyorgy-Apr2021

Conversation

@dwhswenson

Copy link
Copy Markdown
Member

This converts the max_query_size that @sroet had introduced as an instance variable in SQLStorageBackend to a class variable, and adds its use in a corner case that @gyorgy-hantal came across.

It makes more sense to have this as a class variable because it is determined by the way the SQL backend (usually SQLite) was compiled on the local machine, and therefore will be constant throughout a session (for however many files the user opens). Of course, it can still be overridden on an instance-by-instance basis.

Currently WIP because I'm hoping that I can get a regression test, but I may mark it as ready to merge without such a test if it is too annoying to create. @gyorgy-hantal has confirmed that this fixed his issue.

@dwhswenson dwhswenson added bugfix PRs fixing bugs experimental labels Apr 28, 2021
@codecov

codecov Bot commented Apr 28, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1016 (9fcc533) into master (8292193) will increase coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1016      +/-   ##
==========================================
+ Coverage   81.17%   81.27%   +0.10%     
==========================================
  Files         139      139              
  Lines       15143    15149       +6     
==========================================
+ Hits        12292    12313      +21     
+ Misses       2851     2836      -15     
Impacted Files Coverage Δ
openpathsampling/__init__.py 100.00% <0.00%> (ø)
openpathsampling/shooting.py 100.00% <0.00%> (ø)
openpathsampling/netcdfplus/stores/object.py 79.48% <0.00%> (+0.23%) ⬆️
...penpathsampling/storage/stores/snapshot_wrapper.py 77.22% <0.00%> (+0.26%) ⬆️
openpathsampling/collectivevariable.py 75.32% <0.00%> (+8.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8292193...9fcc533. Read the comment docs.

@dwhswenson dwhswenson marked this pull request as ready for review June 3, 2021 18:35
@dwhswenson dwhswenson changed the title [WIP] MAX_SQL_ITEMS as class variable MAX_SQL_ITEMS as class variable Jun 4, 2021

@sroet sroet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@dwhswenson dwhswenson merged commit 4a12af0 into openpathsampling:master Jun 5, 2021
@dwhswenson dwhswenson deleted the simstore-gyorgy-Apr2021 branch June 5, 2021 15:23
@dwhswenson

Copy link
Copy Markdown
Member Author

I couldn't reproduce the error locally (I think because of the way my SQLite is compiled) but this fixed the error on the user end, and I did add tests that should, in principle, check for regression. So I'm going to go ahead and merge this.

@dwhswenson dwhswenson mentioned this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PRs fixing bugs experimental

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants