-
Notifications
You must be signed in to change notification settings - Fork 51
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
Migrate mri_scanner
to the new database abstraction
#1232
Open
maximemulder
wants to merge
1
commit into
aces:main
Choose a base branch
from
maximemulder:sqlalchemy_mri_scanner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
08f95d1
to
ab1289f
Compare
mri_scanner
to the new database abstraction
@maximemulder branch has conflicts after merging #1224 |
ab1289f
to
5e375a9
Compare
@cmadjar rebased ! |
maximemulder
commented
Feb 20, 2025
Comment on lines
+64
to
+74
# TODO: Move this function to a more appropriate place. | ||
def generate_new_cand_id(db: Database) -> int: | ||
""" | ||
Generate a new random CandID that is not already in the database. | ||
""" | ||
|
||
while True: | ||
cand_id = random.randint(100000, 999999) | ||
candidate = try_get_candidate_with_cand_id(db, cand_id) | ||
if candidate is None: | ||
return cand_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually I'd like to move this function to lib.candidate
, but this is future work. I think with the changes in the incremental BIDS importer it might become possible.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: ORM
PR or issue related to the SQLAlchemy integration
Difficulty: Simple
PR or issue that should be easy to implement, review, or test
Refactoring
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on top of #1224. This PR migrates
lib.database_lib.mri_scanner
to the new database abstraction, and migrates the existing code that uses it to the new abstraction.This PR does not migrate the configuration file that still indirectly uses this code, but this can be done in a follow-up PR (or this PR if wanted).