Open ebolyen opened 8 years ago
I think underscores would be better for the format names for the reasons you suggest.
👍 for underscore names
How do we want to handle OrdinationFormat
and OrdinationDirectoryFormat
? I am starting to like the idea of ordination
and ordination_
respectively. This situation actually comes up a lot, and there isn't a great reason to ask for the directory form (instead of the single file) of a single-file directory format anyhow.
Additionally if we could get this change in sooner rather than later, then we can just drop support for the UpperCase
forms since we are still breaking the archive format atm. Then we would be in a position to actually guarantee some level of backwards compatibility.
The recommendation of PEP 8 is to use
UpperCase
for classes, but it does not require it, the typical exception beingunder_scores
for callables.It wouldn't be the craziest thing if they were primarily callables. We could imagine that formats are actually just
pathlib.Path
factories, e.g.path = biom_v2_1_0()
andpath = biom_v2_1_0('some/path.biom')
. This ties in a bit with what @gregcaporaso is currently exploring w.r.t. returning straight paths instead of instances.Reasons this might be a good idea:
Using
UpperCase
makes it hard to delimit version numbers, e.g.BIOMV210Format
vsbiom_v2_1_0
.Using
under_scores
would also be visually distinct from standard object views meaning thatFormat
/DirFmt
suffixes could be assumed by convention.If formats were primarily understood as callables, they get quite a bit simpler conceptually.
Additional examples:
CasavaOneEightSingleLanePerSampleDirFmt
casava_1_8_single_lane_per_sample
SingleLanePerSamplePairedEndFastqDirFmt
single_lane_per_sample_paired_end_fastq
OrdinationFormat
ordination
OrdinationDirectoryFormat
ordination
← we may still need some kind of suffix, but this conflict mostly comes up with single file directory formats. Usually that isn't what you actually want anyways, so perhaps directory formats could have a trailing_
?