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

Feat/algorithm configuration schema #31

Merged
merged 7 commits into from
Sep 20, 2024

Conversation

cbrinson-rise8
Copy link
Collaborator

@cbrinson-rise8 cbrinson-rise8 commented Sep 19, 2024

Description

In models.py add new classes for storing data related to the available algorithms to run.

erDiagram
    Algorithm {
        int id
        bool is_default "a check should be added to guarentee that only 1 row in the table is marked as the default"
        string label "should be unique"
        string description
    }

    AlgorithmPass {
        int id
        int algorithm_id
        int[] blockingkeys "a list of values from the BlockingKey table"
        string[] evaluators "a list of matching functions and values to use"
        string rule "the evaluation rule function"
        float cluster_ratio
        json kwargs "extra parameters to pass to the evalator functions"
    }

    Algorithm ||--o{ AlgorithmPass: "has"
Loading

Related Issues

closes #13

Additional Notes

[Add any additional context or notes that reviewers should know about.]

Checklist

Please review and complete the following checklist before submitting your pull request:

  • I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session.
  • I have reviewed my changes to ensure they are clear, concise, and well-documented.
  • I have updated the documentation, if applicable.
  • I have added or updated test cases to cover my changes, if applicable.
  • I have minimized the number of reviewers to include only those essential for the review.
  • I have notified teammates in the review thread to build awareness.

Checklist for Reviewers

Please review and complete the following checklist during the review process:

  • The code follows best practices and conventions.
  • The changes implement the desired functionality or fix the reported issue.
  • The tests cover the new changes and pass successfully.
  • Any potential edge cases or error scenarios have been considered.

@cbrinson-rise8 cbrinson-rise8 self-assigned this Sep 19, 2024
@cbrinson-rise8 cbrinson-rise8 added the feature New feature or request label Sep 19, 2024
@cbrinson-rise8 cbrinson-rise8 changed the title Feat/algorithm configuration schema draft: Feat/algorithm configuration schema Sep 19, 2024
@cbrinson-rise8 cbrinson-rise8 changed the title draft: Feat/algorithm configuration schema Feat/algorithm configuration schema Sep 19, 2024
@cbrinson-rise8 cbrinson-rise8 marked this pull request as draft September 19, 2024 16:06
@cbrinson-rise8 cbrinson-rise8 force-pushed the feat/algorithm-configuration-schema branch from 0c238bc to 3351e04 Compare September 19, 2024 16:30
@cbrinson-rise8 cbrinson-rise8 force-pushed the feat/algorithm-configuration-schema branch from 3351e04 to 3feb4dc Compare September 19, 2024 16:39
@cbrinson-rise8 cbrinson-rise8 marked this pull request as ready for review September 19, 2024 16:39
.env Outdated Show resolved Hide resolved
Copy link
Collaborator

@alhayward alhayward left a comment

Choose a reason for hiding this comment

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

Nice job!

src/recordlinker/linkage/models.py Show resolved Hide resolved
src/recordlinker/linkage/models.py Show resolved Hide resolved
alembic/versions/3a677cb88b01_create_algorithm_tables.py Outdated Show resolved Hide resolved
alembic/versions/3a677cb88b01_create_algorithm_tables.py Outdated Show resolved Hide resolved
@cbrinson-rise8
Copy link
Collaborator Author

cbrinson-rise8 commented Sep 20, 2024

if target.is_default:
        existing = session.query(Algorithm).filter(Algorithm.is_default == True).first()    # noqa

Link to the line of code

Just a note for anyone wondering what # noqa is. It suppreses the ruff linting error on this line. The reason for this is ruff wants to enforce the use of the is instead of the == operator. But using is doesn't seem to work when comparing SQL boolean values.

Copy link
Collaborator

@ericbuckley ericbuckley 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, thanks for all your work on this @cbrinson-rise8

@ericbuckley
Copy link
Collaborator

@cbrinson-rise8 one more small thing. Can you please add your name to the authors list!

@cbrinson-rise8 cbrinson-rise8 merged commit 6cc3772 into main Sep 20, 2024
4 checks passed
@cbrinson-rise8 cbrinson-rise8 deleted the feat/algorithm-configuration-schema branch September 20, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New schema for Algorithm configuration data
3 participants