Skip to content

Commit

Permalink
Pylint import fix
Browse files Browse the repository at this point in the history
Pylint fix

Fixes the pylint errors caused in the previous commit.
  • Loading branch information
ItIsJordan committed Aug 23, 2023
1 parent dc2f539 commit 37adfdb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions hepdata_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import warnings
from collections import defaultdict
from decimal import Decimal
from re import match as rematch
import numpy as np
import yaml
from future.utils import raise_from
import re

# try to use LibYAML bindings if possible
try:
Expand Down Expand Up @@ -340,7 +340,7 @@ def add_image(self, file_path, outdir=None):
self.image_files.add(file_path)
else:
raise RuntimeError(f"Cannot find image file: {file_path}")

def add_related_doi(self, doi):
"""
Appends a DOI string to the related_tables list.
Expand All @@ -350,7 +350,7 @@ def add_related_doi(self, doi):
"""
# Check against regex here too, maybe?
pattern = r"^10\.17182\/hepdata\.\d+\.v\d+\/t\d+$"
match = re.match(pattern, doi)
match = rematch(pattern, doi)
if match:
to_string = str(doi)
self.related_tables.append(to_string)
Expand Down Expand Up @@ -552,14 +552,12 @@ def add_related_recid(self, r_id):

try:
recid = int(r_id)
except:
raise TypeError(f"Expected 'Integer', instead got '{type(r_id)}'.")
except Exception as exc:
raise TypeError(f"Expected 'Integer', instead got '{type(r_id)}'.") from exc
if recid > 0:
self.related_records.append(recid)
else:
raise ValueError("Please enter a valid integer above 0.")



def read_abstract(self, filepath):
"""
Expand Down

0 comments on commit 37adfdb

Please sign in to comment.