diff --git a/hepdata_lib/__init__.py b/hepdata_lib/__init__.py index 2613a81c..c1fc9f87 100644 --- a/hepdata_lib/__init__.py +++ b/hepdata_lib/__init__.py @@ -55,7 +55,7 @@ def __init__(self): self.files_to_copy = [] self.additional_resources = [] - def add_additional_resource(self, description, location, copy_file=False, file_type=None, + def add_additional_resource(self, description, location, *, copy_file=False, file_type=None, resource_license=None): """ Add any kind of additional resource. @@ -143,7 +143,7 @@ class Variable: # pylint: disable=too-many-instance-attributes # Eight is reasonable in this case. - def __init__(self, name, is_independent=True, is_binned=True, units="", values=None, + def __init__(self, name, *, is_independent=True, is_binned=True, units="", values=None, zero_uncertainties_warning=True): # pylint: disable=too-many-arguments self.name = name diff --git a/tests/test_submission.py b/tests/test_submission.py index 6bee2c01..8a9373ce 100644 --- a/tests/test_submission.py +++ b/tests/test_submission.py @@ -157,7 +157,7 @@ def test_nested_files_to_copy(self): # Add resource to table, add table to Submission sub = Submission() tab = Table('test') - tab.add_additional_resource("a_resource",testfile,True) + tab.add_additional_resource("a_resource",testfile, copy_file=True) sub.add_table(tab) # Write outputs diff --git a/tests/test_table.py b/tests/test_table.py index 1fa434f9..fd06d81f 100644 --- a/tests/test_table.py +++ b/tests/test_table.py @@ -265,7 +265,10 @@ def test_add_additional_resource_license_check(self): some_pdf = f"{os.path.dirname(__file__)}/minimal.pdf" # Set default description, location, copy_file and file_type arguments for a resource file - resource_args = ["Description", some_pdf, True, "Type"] + description = "Description" + location = some_pdf + copy_file = True + file_type = "Type" for data in license_data: # If error is expected, we check for the error @@ -273,14 +276,14 @@ def test_add_additional_resource_license_check(self): if data["error"]: with self.assertRaises(ValueError): test_table.add_additional_resource( - *resource_args, + description, location, copy_file=copy_file, file_type=file_type, resource_license=data["license_data"] ) else: # Check for lack of failure try: test_table.add_additional_resource( - *resource_args, + description, location, copy_file=copy_file, file_type=file_type, resource_license=data["license_data"] ) except ValueError: