Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AmandaBirmingham committed Mar 27, 2024
1 parent a55c0d4 commit fa68d6b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 33 deletions.
11 changes: 11 additions & 0 deletions q2_pysyndna/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@

__name__ = 'q2-pysyndna'
__version__ = _version.get_versions()['version']

__all__ = [__plugin_name__, __package_name__, __description__,
__long_description__, __license__, __author__, __email__,
__url__, __citations_fname__, SyndnaPoolCsvFormat,
SyndnaPoolDirectoryFormat, SyndnaPoolConcentrationTable,
LinearRegressionsYamlFormat, LinearRegressionsDirectoryFormat,
LinearRegressions, PysyndnaLogFormat, PysyndnaLogDirectoryFormat,
PysyndnaLog, TSVLengthFormat, TSVLengthDirectoryFormat, Length,
CoordsFormat, CoordsDirectoryFormat, Coords, fit, count_cells,
count_copies, view_log, view_fit]

3 changes: 1 addition & 2 deletions q2_pysyndna/_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

__plugin_name__ = 'pysyndna'
__package_name__ = 'q2_pysyndna'
__description__ = 'Plugin to calculate absolute microbial cell counts'
Expand All @@ -9,4 +8,4 @@
__author__ = 'Amanda Birmingham'
__email__ = '[email protected]'
__url__ = 'https://github.com/AmandaBirmingham/q2-pysyndna'
__citations_fname__ = 'citations.bib'
__citations_fname__ = 'citations.bib'
2 changes: 1 addition & 1 deletion q2_pysyndna/_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _check_context(context: dict) -> dict:


def _generate_template_fps(html_fnames: list) -> list:
if not INDEX_FNAME in html_fnames:
if INDEX_FNAME not in html_fnames:
html_fnames.append(INDEX_FNAME)
return list(map(
lambda page: os.path.join(TEMPLATES, page), html_fnames))
24 changes: 2 additions & 22 deletions q2_pysyndna/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
LinearRegressionsObjects, LinearRegressions,
LinearRegressionsYamlFormat, LinearRegressionsDirectoryFormat,
yaml_fp_to_linear_regressions_yaml_format,
dict_to_linear_regressions_yaml_format,
linear_regressions_directory_format_to_linear_regressions_objects,
linear_regressions_objects_to_linear_regressions_directory_format)
from q2_pysyndna._type_format_pysyndna_log import (
Expand All @@ -25,14 +24,11 @@
from q2_pysyndna._type_format_length import (
Length,
TSVLengthFormat, TSVLengthDirectoryFormat,
length_fp_to_df,
df_to_tsv_length_format)
length_fp_to_df)
from q2_pysyndna._type_format_coords import (
Coords,
CoordsFormat, CoordsDirectoryFormat,
coords_fp_to_df,
df_to_coords_format
)
coords_fp_to_df)

# plugin instantiation
plugin = Plugin(
Expand Down Expand Up @@ -108,12 +104,6 @@ def _linear_regressions_yaml_format_to_dict(
return yaml_fp_to_linear_regressions_yaml_format(str(data))


# @plugin.register_transformer
# def _dict_to_linear_regressions_yaml_format(
# data: dict) -> LinearRegressionsYamlFormat:
# return dict_to_linear_regressions_yaml_format(data)


@plugin.register_transformer
def _linear_regressions_directory_format_to_linear_regressions_objects(
data: LinearRegressionsDirectoryFormat) -> LinearRegressionsObjects:
Expand All @@ -133,21 +123,11 @@ def _tsv_length_format_to_df(ff: TSVLengthFormat) -> pandas.DataFrame:
return length_fp_to_df(str(ff))


# @plugin.register_transformer
# def _df_to_tsv_length_format(df: pandas.DataFrame) -> TSVLengthFormat:
# return df_to_tsv_length_format(df)


@plugin.register_transformer
def _coords_format_to_df(ff: CoordsFormat) -> pandas.DataFrame:
return coords_fp_to_df(str(ff))


# @plugin.register_transformer
# def _df_to_coords_format(df: pandas.DataFrame) -> CoordsFormat:
# return df_to_coords_format(df)


# Method registrations
plugin.methods.register_function(
function=q2_pysyndna.fit,
Expand Down
13 changes: 5 additions & 8 deletions q2_pysyndna/tests/test_type_format_linear_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class TestLinearRegressionsTransformers(TestPluginBase):

LINREGOBJ_1_2_3 = LinearRegressionsObjects(
linregs_dict=TEST_DICT_1_2_3,
log_msgs_list=["The following syndnas were dropped because they had fewer "
"than 200 total reads aligned:['p166']"])
log_msgs_list=["The following syndnas were dropped because they had "
"fewer than 200 total reads aligned:['p166']"])

@staticmethod
def compare_linear_regressions_directory_formats(
Expand Down Expand Up @@ -254,13 +254,10 @@ def test_linear_regressions_objects_to_linear_regressions_directory_format(
self):
rel_fps = ['linear_regressions',
'linear_regressions_minimal']
abs_fps = [self.get_data_path(rel_fp)
for rel_fp in rel_fps]
abs_fps = [self.get_data_path(rel_fp) for rel_fp in rel_fps]

input_objs = [self.LINREGOBJ_1_2_3,
LinearRegressionsObjects(
self.TEST_DICT_1,
[])]
LinearRegressionsObjects(self.TEST_DICT_1,[])]

for i in range(len(abs_fps)):
abs_fp = abs_fps[i]
Expand All @@ -272,4 +269,4 @@ def test_linear_regressions_objects_to_linear_regressions_directory_format(
for exp_obs_pair in \
self.compare_linear_regressions_directory_formats(
expected_format, out_format):
self.assertEqual(exp_obs_pair[0], exp_obs_pair[1])
self.assertEqual(exp_obs_pair[0], exp_obs_pair[1])

0 comments on commit fa68d6b

Please sign in to comment.