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

adding min_partitions to import_bed #5932

Merged
merged 7 commits into from Apr 24, 2019

Conversation

@konradjk
Copy link
Collaborator

@konradjk konradjk commented Apr 22, 2019

No description provided.

@tpoterba
Copy link
Collaborator

@tpoterba tpoterba commented Apr 22, 2019

should we just accept **kwargs and pass them to import_table?

@jigold
Copy link
Collaborator

@jigold jigold commented Apr 22, 2019

Won't the docs for that be confusing?

@tpoterba
Copy link
Collaborator

@tpoterba tpoterba commented Apr 22, 2019

I dunno. That does seem like the easiest way to make sure everything stays consistent

@konradjk
Copy link
Collaborator Author

@konradjk konradjk commented Apr 22, 2019

How would type-checking and docs work for that?

@tpoterba
Copy link
Collaborator

@tpoterba tpoterba commented Apr 22, 2019

docs would say something like "all optional arguments to import_table are valid arguments to import_bed". Typechecking would happen on the import_table call

@konradjk
Copy link
Collaborator Author

@konradjk konradjk commented Apr 22, 2019

Looks like it needs some sort of typecheck though and i'm not sure what to do with it:

RuntimeError: import_bed: invalid typecheck signature: function parameters with no defined type: ['kwargs']

@konradjk
Copy link
Collaborator Author

@konradjk konradjk commented Apr 23, 2019

How's this @tpoterba ?

@@ -656,7 +659,8 @@ def import_bed(path, reference_genome='default', skip_invalid_intervals=False) -
'f2': tint32, 'f3': tstr,
'f4': tstr},
comment=["""^browser.*""", """^track.*""",
r"""^\w+=("[\w\d ]+"|\d+).*"""])
r"""^\w+=("[\w\d ]+"|\d+).*"""],
Copy link
Collaborator

@jigold jigold Apr 24, 2019

This looks good, but my one concern is if someone overrides one of these options that we know are correct for bed files.

Copy link
Collaborator Author

@konradjk konradjk Apr 24, 2019

What do you mean? If someone passes reference_genome='GRCh38' it will correctly go to import_bed, but anything not in the signature will go on to import_table - if down the line, someone adds reference_genome to import_table, that will be a problem, but not sure if that is fixable here.

Copy link
Collaborator

@tpoterba tpoterba Apr 24, 2019

If someone overrides these they'll get an error that you tried to pass the same argument twice. Maybe better to explicitly check for these options, but it seems hard to really screw yourself here

Copy link
Collaborator Author

@konradjk konradjk Apr 24, 2019

Ohhhh you mean like comment=? 🤔

Copy link
Collaborator

@tpoterba tpoterba Apr 24, 2019

yeah

Copy link
Collaborator

@tpoterba tpoterba Apr 24, 2019

maybe document which ones are used or something?

@konradjk konradjk requested a review from jigold Apr 24, 2019
@konradjk konradjk dismissed jigold’s stale review Apr 24, 2019

documented used arguments

jigold
jigold approved these changes Apr 24, 2019
@danking danking merged commit 7c94df9 into hail-is:master Apr 24, 2019
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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants