Skip to content

Commit

Permalink
Makes quoting consistent: user-facing strings double, keys etc single
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisKeefe committed Jun 1, 2020
1 parent ae674f3 commit fd0e24e
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 127 deletions.
8 changes: 4 additions & 4 deletions q2_diversity_lib/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _disallow_empty_tables(some_function, *args, **kwargs):
f"{type(table)}")

if table_obj.is_empty():
raise ValueError('The provided table is empty')
raise ValueError("The provided table is empty")

return some_function(*args, **kwargs)

Expand All @@ -71,9 +71,9 @@ def _safely_constrain_n_jobs(some_function, *args, **kwargs):
except AttributeError:
cpus = psutil.cpu_count(logical=False)
if n_jobs > cpus:
raise ValueError('The value of n_jobs cannot exceed the'
f' number of processors ({cpus}) available in'
' this system.')
raise ValueError("The value of n_jobs cannot exceed the"
f" number of processors ({cpus}) available in"
" this system.")

# skbio and unifrac handle n_jobs args differently:
if n_jobs == 0:
Expand Down
242 changes: 121 additions & 121 deletions q2_diversity_lib/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

citations = Citations.load('citations.bib', package='q2_diversity_lib')
plugin = Plugin(
name='diversity-lib',
name="diversity-lib",
version=q2_diversity_lib.__version__,
website='https://github.com/qiime2/q2-diversity-lib',
short_description='Plugin for computing community diversity.',
package='q2_diversity_lib',
description='This QIIME 2 plugin computes individual metrics for '
' community alpha and beta diversity.',
website="https://github.com/qiime2/q2-diversity-lib",
short_description="Plugin for computing community diversity.",
package="q2_diversity_lib",
description="This QIIME 2 plugin computes individual metrics for "
" community alpha and beta diversity.",
)

# ------------------------ alpha-diversity -----------------------
Expand All @@ -36,20 +36,20 @@
outputs=[('vector',
SampleData[AlphaDiversity])],
input_descriptions={
'table': 'The feature table containing the samples for which Faith\'s '
'phylogenetic diversity should be computed. Table values '
'will be converted to presence/absence.',
'phylogeny': 'Phylogenetic tree containing tip identifiers that '
'correspond to the feature identifiers in the table. '
'This tree can contain tip ids that are not present in '
'the table, but all feature ids in the table must be '
'present in this tree.'},
'table': "The feature table containing the samples for which Faith's "
"phylogenetic diversity should be computed. Table values "
"will be converted to presence/absence.",
'phylogeny': "Phylogenetic tree containing tip identifiers that "
"correspond to the feature identifiers in the table. "
"This tree can contain tip ids that are not present in "
"the table, but all feature ids in the table must be "
"present in this tree."},
parameter_descriptions=None,
output_descriptions={'vector': 'Vector containing per-sample values for '
'Faith\'s Phylogenetic Diversity.'},
name='Faith\'s Phylogenetic Diversity',
description='Computes Faith\'s Phylogenetic Diversity for all samples in '
'a feature table.',
output_descriptions={'vector': "Vector containing per-sample values for "
"Faith's Phylogenetic Diversity."},
name="Faith's Phylogenetic Diversity",
description="Computes Faith's Phylogenetic Diversity for all samples in "
"a feature table.",
citations=[citations['faith1992conservation']]
)

Expand All @@ -60,16 +60,16 @@
parameters=None,
outputs=[('vector',
SampleData[AlphaDiversity])],
input_descriptions={'table': 'The feature table containing the samples '
'for which the number of observed features should be '
'calculated. Table values will be converted to '
'presence/absence.'},
input_descriptions={'table': "The feature table containing the samples "
"for which the number of observed features should be "
"calculated. Table values will be converted to "
"presence/absence."},
parameter_descriptions=None,
output_descriptions={'vector': 'Vector containing per-sample counts of '
'observed features.'},
name='Observed Features',
description='Compute the number of observed features for each sample in a '
'feature table'
output_descriptions={'vector': "Vector containing per-sample counts of "
"observed features."},
name="Observed Features",
description="Compute the number of observed features for each sample in a "
"feature table"
)

plugin.methods.register_function(
Expand All @@ -78,17 +78,17 @@
parameters={'drop_undefined_samples': Bool},
outputs=[('vector',
SampleData[AlphaDiversity])],
input_descriptions={'table': 'The feature table containing the samples '
'for which Pielou\'s evenness should be computed.'},
parameter_descriptions={'drop_undefined_samples': 'Samples with fewer than'
' two observed features produce undefined (NaN) '
'values. If true, these samples are dropped '
'from the output vector.'},
output_descriptions={'vector': 'Vector containing per-sample values '
'for Pielou\'s Evenness.'},
name='Pielou\'s Evenness',
description='Compute Pielou\'s Evenness for each sample in a '
'feature table',
input_descriptions={'table': "The feature table containing the samples "
"for which Pielou's evenness should be computed."},
parameter_descriptions={'drop_undefined_samples': "Samples with fewer than"
" two observed features produce undefined (NaN) "
"values. If true, these samples are dropped "
"from the output vector."},
output_descriptions={'vector': "Vector containing per-sample values "
"for Pielou's Evenness."},
name="Pielou's Evenness",
description="Compute Pielou's Evenness for each sample in a "
"feature table",
citations=[citations['pielou1966measurement']]
)

Expand All @@ -98,17 +98,17 @@
parameters={'drop_undefined_samples': Bool},
outputs=[('vector',
SampleData[AlphaDiversity])],
input_descriptions={'table': 'The feature table containing the samples '
'for which Shannon\'s Entropy should be computed.'},
parameter_descriptions={'drop_undefined_samples': 'Samples with no '
'observed features produce undefined (NaN) values.'
' If true, these samples are dropped from the '
'output vector.'},
output_descriptions={'vector': 'Vector containing per-sample values '
'for Shannon\'s Entropy.'},
name='Shannon\'s Entropy',
description='Compute Shannon\'s Entropy for each sample in a '
'feature table',
input_descriptions={'table': "The feature table containing the samples "
"for which Shannon's Entropy should be computed."},
parameter_descriptions={'drop_undefined_samples': "Samples with no "
"observed features produce undefined (NaN) values."
" If true, these samples are dropped from the "
"output vector."},
output_descriptions={'vector': "Vector containing per-sample values "
"for Shannon's Entropy."},
name="Shannon's Entropy",
description="Compute Shannon's Entropy for each sample in a "
"feature table",
citations=[citations['shannon1948communication']]
)

Expand All @@ -120,24 +120,24 @@
parameters={'n_jobs': Int},
outputs=[('distance_matrix', DistanceMatrix)],
input_descriptions={
'table': 'The feature table containing the samples for which '
'Bray-Curtis dissimilarity should be computed.'},
'table': "The feature table containing the samples for which "
"Bray-Curtis dissimilarity should be computed."},
parameter_descriptions={
'n_jobs': 'The number of CPU threads to use in performing this '
'calculation. More threads = faster performance. May not '
'exceed the number of available physical cores. If n-jobs = '
'-1, all CPUs are used. For n-jobs < -1, (n_cpus + 1 + '
'n-jobs) are used. E.g if n-jobs = -2, all CPUs but'
' one are used.'},
'n_jobs': "The number of CPU threads to use in performing this "
"calculation. More threads = faster performance. May not "
"exceed the number of available physical cores. If n-jobs = "
"-1, all CPUs are used. For n-jobs < -1, (n_cpus + 1 + "
"n-jobs) are used. E.g if n-jobs = -2, all CPUs but"
" one are used."},
output_descriptions={
'distance_matrix': 'Distance matrix for Bray-Curtis dissimilarity'},
name='Bray-Curtis Dissimilarity',
description='Compute Bray-Curtis dissimilarity for each sample in a '
'feature table. Note: Frequency and relative frequency data '
'produce different results unless overall sample sizes are '
'identical. Please consider the impact on your results if '
'you use Bray-Curtis with count data that has not been '
'adjusted (normalized).',
'distance_matrix': "Distance matrix for Bray-Curtis dissimilarity"},
name="Bray-Curtis Dissimilarity",
description="Compute Bray-Curtis dissimilarity for each sample in a "
"feature table. Note: Frequency and relative frequency data "
"produce different results unless overall sample sizes are "
"identical. Please consider the impact on your results if "
"you use Bray-Curtis with count data that has not been "
"adjusted (normalized).",
citations=[citations['sorensen1948method']])

# TODO: Augment citations as needed/
Expand All @@ -148,23 +148,23 @@
parameters={'n_jobs': Int},
outputs=[('distance_matrix', DistanceMatrix)],
input_descriptions={
'table': 'The feature table containing the samples for which '
'Jaccard distance should be computed.'},
'table': "The feature table containing the samples for which "
"Jaccard distance should be computed."},
parameter_descriptions={
'n_jobs': 'The number of CPU threads to use in performing this '
'calculation. More threads = faster performance. May not '
'exceed the number of available physical cores. If n-jobs = '
'-1, all CPUs are used. For n-jobs < -1, (n_cpus + 1 + '
'n-jobs) are used. E.g. if n-jobs = -2, all CPUs but'
' one are used.'},
'n_jobs': "The number of CPU threads to use in performing this "
"calculation. More threads = faster performance. May not "
"exceed the number of available physical cores. If n-jobs = "
"-1, all CPUs are used. For n-jobs < -1, (n_cpus + 1 + "
"n-jobs) are used. E.g. if n-jobs = -2, all CPUs but"
" one are used."},
output_descriptions={
'distance_matrix': 'Distance matrix for Jaccard index'},
name='Jaccard Distance',
description='Compute Jaccard distance for each sample '
'in a feature table. Jaccard is calculated using'
'presence/absence data. Data of type '
'FeatureTable[Frequency | Relative Frequency] is reduced'
'to presence/absence prior to calculation.',
'distance_matrix': "Distance matrix for Jaccard index"},
name="Jaccard Distance",
description="Compute Jaccard distance for each sample "
"in a feature table. Jaccard is calculated using"
"presence/absence data. Data of type "
"FeatureTable[Frequency | Relative Frequency] is reduced"
"to presence/absence prior to calculation.",
citations=[citations['jaccard1908nouvelles']])


Expand All @@ -177,28 +177,28 @@
'bypass_tips': Bool},
outputs=[('distance_matrix', DistanceMatrix)],
input_descriptions={
'table': 'The feature table containing the samples for which '
'Unweighted Unifrac should be computed.',
'phylogeny': 'Phylogenetic tree containing tip identifiers that '
'correspond to the feature identifiers in the table. '
'This tree can contain tip ids that are not present in '
'the table, but all feature ids in the table must be '
'present in this tree.'},
'table': "The feature table containing the samples for which "
"Unweighted Unifrac should be computed.",
'phylogeny': "Phylogenetic tree containing tip identifiers that "
"correspond to the feature identifiers in the table. "
"This tree can contain tip ids that are not present in "
"the table, but all feature ids in the table must be "
"present in this tree."},
parameter_descriptions={
'n_jobs': 'The number of CPU threads to use in performing this '
'calculation. More threads = faster performance. May not '
'exceed the number of available physical cores.',
'n_jobs': "The number of CPU threads to use in performing this "
"calculation. More threads = faster performance. May not "
"exceed the number of available physical cores.",
'bypass_tips':
('In a bifurcating tree, the tips make up about 50% of '
'the nodes in a tree. By ignoring them, specificity '
'can be traded for reduced compute time. This has the'
' effect of collapsing the phylogeny, and is analogous'
' (in concept) to moving from 99% to 97% OTUs')},
output_descriptions={'distance_matrix': 'Distance matrix for Unweighted '
'Unifrac.'},
name='Unweighted Unifrac',
description='Compute Unweighted Unifrac for each sample in a '
'feature table',
("In a bifurcating tree, the tips make up about 50% of "
"the nodes in a tree. By ignoring them, specificity "
"can be traded for reduced compute time. This has the"
" effect of collapsing the phylogeny, and is analogous"
" (in concept) to moving from 99% to 97% OTUs")},
output_descriptions={'distance_matrix': "Distance matrix for Unweighted "
"Unifrac."},
name="Unweighted Unifrac",
description="Compute Unweighted Unifrac for each sample in a "
"feature table",
citations=[
citations['lozupone2005unifrac'],
citations['lozupone2007unifrac'],
Expand All @@ -215,28 +215,28 @@
'bypass_tips': Bool},
outputs=[('distance_matrix', DistanceMatrix)],
input_descriptions={
'table': 'The feature table containing the samples for which '
'Weighted Unifrac should be computed.',
'phylogeny': 'Phylogenetic tree containing tip identifiers that '
'correspond to the feature identifiers in the table. '
'This tree can contain tip ids that are not present in '
'the table, but all feature ids in the table must be '
'present in this tree.'},
'table': "The feature table containing the samples for which "
"Weighted Unifrac should be computed.",
'phylogeny': "Phylogenetic tree containing tip identifiers that "
"correspond to the feature identifiers in the table. "
"This tree can contain tip ids that are not present in "
"the table, but all feature ids in the table must be "
"present in this tree."},
parameter_descriptions={
'n_jobs': 'The number of CPU threads to use in performing this '
'calculation. More threads = faster performance. May not '
'exceed the number of available physical cores.',
'n_jobs': "The number of CPU threads to use in performing this "
"calculation. More threads = faster performance. May not "
"exceed the number of available physical cores.",
'bypass_tips':
('In a bifurcating tree, the tips make up about 50% of '
'the nodes in a tree. By ignoring them, specificity '
'can be traded for reduced compute time. This has the'
' effect of collapsing the phylogeny, and is analogous'
' (in concept) to moving from 99% to 97% OTUs')},
output_descriptions={'distance_matrix': 'Distance matrix for Unweighted '
'Unifrac.'},
name='Weighted Unifrac',
description='Compute Weighted Unifrac for each sample in a '
'feature table',
("In a bifurcating tree, the tips make up about 50% of "
"the nodes in a tree. By ignoring them, specificity "
"can be traded for reduced compute time. This has the"
" effect of collapsing the phylogeny, and is analogous"
" (in concept) to moving from 99% to 97% OTUs")},
output_descriptions={'distance_matrix': "Distance matrix for Unweighted "
"Unifrac."},
name="Weighted Unifrac",
description="Compute Weighted Unifrac for each sample in a "
"feature table",
citations=[
citations['lozupone2005unifrac'],
citations['lozupone2007unifrac'],
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import versioneer

setup(
name='q2-diversity-lib',
name="q2-diversity-lib",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
packages=find_packages(),
Expand All @@ -22,7 +22,7 @@
["q2-diversity-lib=q2_diversity_lib.plugin_setup:plugin"]
},
url="https://qiime2.org",
license='BSD-3-Clause',
license="BSD-3-Clause",
package_data={
'q2_diversity_lib': ['citations.bib'],
'q2_diversity_lib.tests': ['data/*']
Expand Down

0 comments on commit fd0e24e

Please sign in to comment.