Skip to content

Commit

Permalink
importlib simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
WardDeb committed Nov 16, 2023
1 parent cf307c6 commit 0286701
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 65 deletions.
6 changes: 1 addition & 5 deletions deeptools/alignmentSieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions deeptools/bamPEFragmentSize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions deeptools/computeMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down
6 changes: 1 addition & 5 deletions deeptools/computeMatrixOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions deeptools/deeptools_list_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions deeptools/estimateReadFiltering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions deeptools/estimateScaleFactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion deeptools/getFragmentAndReadSize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions deeptools/multiBamSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down
5 changes: 1 addition & 4 deletions deeptools/multiBigwigSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
6 changes: 1 addition & 5 deletions deeptools/parserCommon.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 1 addition & 5 deletions deeptools/plotCorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
6 changes: 1 addition & 5 deletions deeptools/plotCoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
6 changes: 1 addition & 5 deletions deeptools/plotPCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0286701

Please sign in to comment.