Skip to content

Commit

Permalink
PEP8/pylint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Peisach committed May 26, 2024
1 parent 7e0ae9e commit b453d11
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions wwpdb/apps/ann_tasks_v2/correspnd/CorresPNDTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def __doRender(self):
myD["major_release"] = self.__letterTemplateMap["major_release"]
myD["major_minor_addition"] = self.__letterTemplateMap["major_minor_addition"]
myD["minor"] = self.__letterTemplateMap["minor"]
myD["minor_release"],is_repl_rel = self.__getRelaseInfo()
myD["minor_release"], is_repl_rel = self.__getRelaseInfo()
if is_repl_rel:
myD["major_release"] = self.__letterTemplateMap["release_repl_rel"]
#
Expand Down Expand Up @@ -739,7 +739,7 @@ def __getRelaseInfo(self):
text += self.__letterTemplateMap["pre_release_no"]
#
#
return text,is_repl_rel
return text, is_repl_rel

def __getTableContext(self, count):
text = ""
Expand Down
3 changes: 3 additions & 0 deletions wwpdb/apps/ann_tasks_v2/report/PdbxReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ def doReport(self, contentType="model"):
pdbxR = PdbxLinksReportIo(verbose=self.__verbose, log=self.__lfh)
elif contentType == "em-map-info-report":
pdbxR = EmInfoReportIo(verbose=self.__verbose, log=self.__lfh)
else:
self.__lfh.write("+PdbxReport.doReport() - unknown contentType %s\n" % contentType)
return oD

pdbxR.setFilePath(localPath, idCode=None)
pdbxR.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
__email__ = "[email protected]"
__license__ = "Apache 2.0"



from mmcif_utils.style.PdbxCategoryStyleBase import PdbxCategoryStyleBase


Expand Down Expand Up @@ -107,7 +105,7 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_entity_assembly.id', '%s', 'str', ''),
('_em_entity_assembly.assembly_id', '%s', 'str', ''),
('_em_entity_assembly.parent_id', '%s', 'str', ''),
#('_em_entity_assembly.chimera', '%s', 'str', ''),
# ('_em_entity_assembly.chimera', '%s', 'str', ''),
('_em_entity_assembly.source', '%s', 'str', ''),
('_em_entity_assembly.type', '%s', 'str', ''),
('_em_entity_assembly.name', '%s', 'str', ''),
Expand Down Expand Up @@ -290,13 +288,13 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_3d_reconstruction.nominal_pixel_size', '%s', 'str', ''),
('_em_3d_reconstruction.actual_pixel_size', '%s', 'str', ''),
('_em_3d_reconstruction.num_particles', '%s', 'str', ''),
#('_em_3d_reconstruction.num_subtomograms', '%s', 'str', ''),
# ('_em_3d_reconstruction.num_subtomograms', '%s', 'str', ''),
('_em_3d_reconstruction.euler_angles_details', '%s', 'str', ''),
('_em_3d_reconstruction.num_class_averages', '%s', 'str', ''),
('_em_3d_reconstruction.software', '%s', 'str', ''),
('_em_3d_reconstruction.fsc_type', '%s', 'str', ''),
('_em_3d_reconstruction.image_processing_id', '%s', 'str', ''),
#('_em_3d_reconstruction.software_id_list', '%s', 'str', ''),
# ('_em_3d_reconstruction.software_id_list', '%s', 'str', ''),
('_em_3d_reconstruction.symmetry_type', '%s', 'str', ''),
],
'em_3d_fitting': [
Expand All @@ -309,7 +307,7 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_3d_fitting.overall_b_value', '%s', 'str', ''),
('_em_3d_fitting.ref_space', '%s', 'str', ''),
('_em_3d_fitting.ref_protocol', '%s', 'str', ''),
#('_em_3d_fitting.software_id_list', '%s', 'str', ''),
# ('_em_3d_fitting.software_id_list', '%s', 'str', ''),
],
'em_3d_fitting_list': [
('_em_3d_fitting_list.id', '%s', 'str', ''),
Expand Down Expand Up @@ -588,7 +586,7 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_tomography.imaging_id', '%s', 'str', ''),
],
'em_image_recording': [
#('_em_image_recording.approximate_date', '%s', 'str', ''),
# ('_em_image_recording.approximate_date', '%s', 'str', ''),
('_em_image_recording.average_exposure_time', '%s', 'str', ''),
('_em_image_recording.avg_electron_dose_per_image', '%s', 'str', ''),
('_em_image_recording.details', '%s', 'str', ''),
Expand Down Expand Up @@ -656,7 +654,7 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_ctf_correction.amplitude_correction_space', '%s', 'str', ''),
('_em_ctf_correction.correction_operation', '%s', 'str', ''),
('_em_ctf_correction.details', '%s', 'str', ''),
#('_em_ctf_correction.em_software_id', '%s', 'str', ''),
# ('_em_ctf_correction.em_software_id', '%s', 'str', ''),
('_em_ctf_correction.id', '%s', 'str', ''),
('_em_ctf_correction.phase_reversal', '%s', 'str', ''),
('_em_ctf_correction.phase_reversal_anisotropic', '%s', 'str', ''),
Expand All @@ -667,7 +665,7 @@ class PdbxEmExtensionCategoryStyle(PdbxCategoryStyleBase):
('_em_ctf_correction.amplitude_correction_space', '%s', 'str', ''),
('_em_ctf_correction.correction_operation', '%s', 'str', ''),
('_em_ctf_correction.details', '%s', 'str', ''),
#('_em_ctf_correction.em_software_id', '%s', 'str', ''),
# ('_em_ctf_correction.em_software_id', '%s', 'str', ''),
('_em_ctf_correction.id', '%s', 'str', ''),
('_em_ctf_correction.phase_reversal', '%s', 'str', ''),
('_em_ctf_correction.phase_reversal_anisotropic', '%s', 'str', ''),
Expand Down
1 change: 1 addition & 0 deletions wwpdb/apps/ann_tasks_v2/report/styles/PdbxIo.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ def update(self, catName, attributeName, value, iRow=0):
def write(self, filePath):
return self.writeFile(filePath)


class EmInfoReportIo(PdbxStyleIoUtil):
"""Methods for reading EM information details."""

Expand Down
2 changes: 1 addition & 1 deletion wwpdb/apps/ann_tasks_v2/webapp/CommonTasksWebAppWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2303,7 +2303,7 @@ def _renderCheckReports(self, entryId, fileSource="archive", instance=None, cont
versionId = "latest"
else:
versionId = "none"

# Try to avoid fetch if not needed
downloadPath = du.getFilePath(entryId, contentType="model", formatType="pdbx", fileSource=fileSource, instance=instance, versionId=versionId)
if downloadPath is None or not os.path.exists(downloadPath):
Expand Down
2 changes: 2 additions & 0 deletions wwpdb/apps/ann_tasks_v2/webapp/ReviewDataWebAppWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def _updateAndReportFileOps(self):
rC = ResponseContent(reqObj=self._reqObj, verbose=self._verbose, log=self._lfh)
rC.setReturnFormat("json")

contentType = contentFormat = partitionNumber = None
if self._isFileUpload():
# make a copy of the file in the session directory and set 'fileName'
self._uploadFile()
Expand Down Expand Up @@ -149,6 +150,7 @@ def _updateAndReportFileOps(self):
#
pR = PdbxReport(reqObj=self._reqObj, verbose=self._verbose, log=self._lfh)
aTagList.append(du.getAnchorTag())
downloadPath = du.getDownloadPath()
layout = "multiaccordion"
htmlList.extend(pR.makeTabularReport(filePath=downloadPath, contentType=contentType, idCode=idCode, layout=layout))
if len(aTagList) > 0:
Expand Down

0 comments on commit b453d11

Please sign in to comment.