diff --git a/deeptools/alignmentSieve.py b/deeptools/alignmentSieve.py index 4f2aa18793..feb40d1073 100644 --- a/deeptools/alignmentSieve.py +++ b/deeptools/alignmentSieve.py @@ -7,12 +7,8 @@ from deeptools import parserCommon from deeptools.bamHandler import openBam from deeptools.mapReduce import mapReduce -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version from deeptools.utilities import getTLen, smartLabels, getTempFileName - +from importlib.metadata import version def parseArguments(): parser = argparse.ArgumentParser( diff --git a/deeptools/bamPEFragmentSize.py b/deeptools/bamPEFragmentSize.py index ad63fa14fd..118b83c9c8 100755 --- a/deeptools/bamPEFragmentSize.py +++ b/deeptools/bamPEFragmentSize.py @@ -18,11 +18,7 @@ # own tools from deeptools.parserCommon import writableFile from deeptools.getFragmentAndReadSize import get_read_and_fragment_length -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version def parse_arguments(): parser = argparse.ArgumentParser( diff --git a/deeptools/computeMatrix.py b/deeptools/computeMatrix.py index 440358c9b2..8287d1dd71 100644 --- a/deeptools/computeMatrix.py +++ b/deeptools/computeMatrix.py @@ -7,15 +7,11 @@ import multiprocessing from deeptools.parserCommon import writableFile, numberOfProcessors -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version from deeptools import parserCommon from deeptools import heatmapper import deeptools.computeMatrixOperations as cmo import deeptools.deepBlue as db - +from importlib.metadata import version def parse_arguments(args=None): parser = \ diff --git a/deeptools/computeMatrixOperations.py b/deeptools/computeMatrixOperations.py index b246b9ce08..978d7eb256 100755 --- a/deeptools/computeMatrixOperations.py +++ b/deeptools/computeMatrixOperations.py @@ -6,11 +6,7 @@ import sys import os import csv -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version def parse_arguments(): parser = argparse.ArgumentParser( diff --git a/deeptools/deeptools_list_tools.py b/deeptools/deeptools_list_tools.py index 0e4b6a387f..53983093dc 100644 --- a/deeptools/deeptools_list_tools.py +++ b/deeptools/deeptools_list_tools.py @@ -3,11 +3,7 @@ import argparse import sys -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version def parse_arguments(args=None): parser = argparse.ArgumentParser( diff --git a/deeptools/estimateReadFiltering.py b/deeptools/estimateReadFiltering.py index 52fded5382..13d52599d7 100644 --- a/deeptools/estimateReadFiltering.py +++ b/deeptools/estimateReadFiltering.py @@ -5,11 +5,7 @@ from deeptools import parserCommon, bamHandler, utilities from deeptools.mapReduce import mapReduce from deeptools.utilities import smartLabels -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version def parseArguments(): parser = argparse.ArgumentParser( diff --git a/deeptools/estimateScaleFactor.py b/deeptools/estimateScaleFactor.py index 31acea3f57..549ecf7808 100644 --- a/deeptools/estimateScaleFactor.py +++ b/deeptools/estimateScaleFactor.py @@ -6,11 +6,7 @@ from deeptools.SES_scaleFactor import estimateScaleFactor from deeptools.parserCommon import numberOfProcessors -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version debug = 0 diff --git a/deeptools/getFragmentAndReadSize.py b/deeptools/getFragmentAndReadSize.py index 427d5308cf..0cf2dc8eba 100644 --- a/deeptools/getFragmentAndReadSize.py +++ b/deeptools/getFragmentAndReadSize.py @@ -76,7 +76,8 @@ def get_read_and_fragment_length(bamFile, return_lengths=False, blackListFileNam ------- d : dict tuple of two dictionaries, one for the fragment length and the other - for the read length. The dictionaries summarise the mean, median etc. values +for the read length. The dictionaries summarise the mean, median etc. values + """ bam_handle = bamHandler.openBam(bamFile) diff --git a/deeptools/multiBamSummary.py b/deeptools/multiBamSummary.py index b010001ff6..981a99e3c2 100644 --- a/deeptools/multiBamSummary.py +++ b/deeptools/multiBamSummary.py @@ -9,11 +9,7 @@ import deeptools.countReadsPerBin as countR from deeptools import parserCommon from deeptools.utilities import smartLabels -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version old_settings = np.seterr(all='ignore') diff --git a/deeptools/multiBigwigSummary.py b/deeptools/multiBigwigSummary.py index 50f40beef5..22789647b8 100644 --- a/deeptools/multiBigwigSummary.py +++ b/deeptools/multiBigwigSummary.py @@ -10,10 +10,7 @@ from deeptools.utilities import smartLabels import deeptools.getScorePerBigWigBin as score_bw import deeptools.deepBlue as db -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version +from importlib.metadata import version old_settings = np.seterr(all='ignore') diff --git a/deeptools/parserCommon.py b/deeptools/parserCommon.py index 37e9f359ab..7a94b0f577 100755 --- a/deeptools/parserCommon.py +++ b/deeptools/parserCommon.py @@ -1,10 +1,6 @@ import argparse import os -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version - +from importlib.metadata import version def check_float_0_1(value): v = float(value) diff --git a/deeptools/plotCorrelation.py b/deeptools/plotCorrelation.py index 2b8d9f790a..988cf559e2 100644 --- a/deeptools/plotCorrelation.py +++ b/deeptools/plotCorrelation.py @@ -10,13 +10,9 @@ matplotlib.rcParams['svg.fonttype'] = 'none' from deeptools import cm # noqa: F401 import matplotlib.pyplot as plt - +from importlib.metadata import version from deeptools.correlation import Correlation from deeptools.parserCommon import writableFile -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version old_settings = np.seterr(all='ignore') diff --git a/deeptools/plotCoverage.py b/deeptools/plotCoverage.py index e233dcb717..a3235955c9 100755 --- a/deeptools/plotCoverage.py +++ b/deeptools/plotCoverage.py @@ -14,14 +14,10 @@ import matplotlib.pyplot as plt import plotly.offline as py import plotly.graph_objs as go - +from importlib.metadata import version import deeptools.countReadsPerBin as countR from deeptools import parserCommon from deeptools.utilities import smartLabels -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version old_settings = np.seterr(all='ignore') diff --git a/deeptools/plotPCA.py b/deeptools/plotPCA.py index c43942b85b..bc17ed32b1 100644 --- a/deeptools/plotPCA.py +++ b/deeptools/plotPCA.py @@ -8,13 +8,9 @@ matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['svg.fonttype'] = 'none' from deeptools import cm # noqa: F401 - +from importlib.metadata import version from deeptools.correlation import Correlation from deeptools.parserCommon import writableFile -try: # keep python 3.7 support. - from importlib.metadata import version -except ModuleNotFoundError: - from importlib_metadata import version def parse_arguments(args=None):