Skip to content

Commit

Permalink
Minor refactorization
Browse files Browse the repository at this point in the history
  • Loading branch information
percyfal committed Sep 20, 2024
1 parent f94234e commit aff19f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions bio2zarr/bed2zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ def make_field_def(name, alias, dtype=None, *, description=""):
return fields[:num_fields]


def mkfields(bed_type):
mandatory = mandatory_bed_field_definitions()
optional = optional_bed_field_definitions(bed_type.value - BedType.BED3.value)
return mandatory + optional


def mkschema(bed_path, out):
bed_type = guess_bed_file_type(bed_path)
data = pd.read_table(bed_path, header=None)
Expand All @@ -335,12 +341,6 @@ def mkschema(bed_path, out):
out.write(spec.asjson())


def mkfields(bed_type):
mandatory = mandatory_bed_field_definitions()
optional = optional_bed_field_definitions(bed_type.value - BedType.BED3.value)
return mandatory + optional


def bed2zarr_init(
bed_path,
bed_type,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TestBedData:
@pytest.mark.parametrize("bed_data", ALL_BED_FORMATS, indirect=True)
def test_guess_bed_type_from_path(self, bed_path, request):
bedspec = request.node.callspec.params["bed_data"]
if bedspec in [2, 10, 11, 13]:
if bedspec in DISALLOWED_BED_FORMATS:
with pytest.raises(ValueError):
bed2zarr.guess_bed_file_type(bed_path)
else:
Expand Down

0 comments on commit aff19f2

Please sign in to comment.