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

Dev bedclassify 2025 pydantic refactor #107

Merged

Conversation

donaldcampbelljr
Copy link
Member

Refactor the classification code to be cleaner and to return pydantic object.

@donaldcampbelljr donaldcampbelljr marked this pull request as ready for review February 26, 2025 21:19
Comment on lines +123 to +138
0: [lambda col: col.dtype == "O" or col.dtype == "int" or col.dtype == "float"],
1: [lambda col: col.dtype == "int" and (col >= 0).all()],
2: [lambda col: col.dtype == "int" and (col >= 0).all()],
3: [lambda col: col.dtype == "O"],
4: [
lambda col: col.dtype == "int" and col.between(0, 1000).all(),
],
5: [lambda col: col.isin(["+", "-", "."]).all()],
6: [lambda col: col.dtype == "int" and (col >= 0).all()],
7: [lambda col: col.dtype == "int" and (col >= 0).all()],
8: [lambda col: col.dtype == "int" and (col >= 0).all()],
9: [lambda col: col.dtype == "int"],
10: [
lambda col: col.astype(str).str.match(r"^(0(,\d+)*|\d+(,\d+)*)?,?$").all()
],
11: [
Copy link
Member

Choose a reason for hiding this comment

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

Very smart

@khoroshevskyi khoroshevskyi merged commit 25aa8a6 into dev_bedclassify_2025 Mar 6, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants