Skip to content

Commit

Permalink
Fixed Codacy issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
n2iw committed Aug 27, 2020
1 parent 2880e97 commit 91cc5e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions adapters/glioma.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def __init__(self):
self.cleanup_fields.append('SRA_accession')

@staticmethod
def _dash_to_underscore(input):
return input.replace('-', '_')
def _dash_to_underscore(org):
return org.replace('-', '_')

def get_org_url(self):
"""
Expand Down
19 changes: 10 additions & 9 deletions file_copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
if LOG_PREFIX not in os.environ:
os.environ[LOG_PREFIX] = 'File_Loader'

""""
This script copies (stream in memory) files from an URL to specified S3 bucket

Inputs:
pre-manifest: TSV file that contains all information of original files
target bucket:
"""
# This script copies (stream in memory) files from an URL to specified S3 bucket
#
# Inputs:
# pre-manifest: TSV file that contains all information of original files
# target bucket:


class FileLoader:
Expand Down Expand Up @@ -195,15 +194,17 @@ def populate_neo4j_record(self, record, result):
record[Copier.ACL] = result[Copier.ACL]
return record

def _clean_up_field_names(self, headers):
@staticmethod
def _clean_up_field_names(headers):
'''
Removes leading and trailing spaces from header names
:param headers:
:return:
'''
return [header.strip() for header in headers]

def _clean_up_record(self, record):
@staticmethod
def _clean_up_record(record):
'''
Removes leading and trailing spaces from keys in org_record
:param record:
Expand All @@ -216,7 +217,7 @@ def _read_pre_manifest(self):
with open(self.pre_manifest) as pre_m:
reader = csv.DictReader(pre_m, delimiter='\t')
self.field_names = self._clean_up_field_names(reader.fieldnames)
for i in range(self.skip):
for _ in range(self.skip):
next(reader)
self.files_skipped += 1

Expand Down
4 changes: 2 additions & 2 deletions loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ def main():
log.info('No files to load.')


except ServiceUnavailable as err:
except ServiceUnavailable:
log.critical("Neo4j service not available at: \"{}\"".format(config.neo4j_uri))
return
except AuthError as err:
except AuthError:
log.error("Wrong Neo4j username or password!")
return

Expand Down

0 comments on commit 91cc5e4

Please sign in to comment.