Skip to content
Snippets Groups Projects
Verified Commit 5f0ad95d authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Linting

parent 6cda8781
No related branches found
No related tags found
1 merge request!100WIP: Filling XLSX: Seems to be working.
Pipeline #49437 passed with warnings
......@@ -41,6 +41,9 @@ class AnalysisCFood(AbstractFileCFood, WithREADME):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
WithREADME.__init__(self)
self.analysis = None
self.people = None
self.project = None
def collect_information(self):
self.find_referenced_files([RESULTS, SOURCES, SCRIPTS])
......
......@@ -16,17 +16,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
from itertools import chain
import caosdb as db
from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_parent,
from caosadvancedtools.cfood import (AbstractFileCFood,
assure_has_property,
assure_object_is_in_list, get_entity)
from caosadvancedtools.read_md_header import get_header
assure_object_is_in_list,
)
from .generic_pattern import full_pattern
from .utils import (get_files_referenced_by_field, parse_responsibles,
from .utils import (parse_responsibles,
reference_records_corresponding_to_files)
from .withreadme import DATAMODEL as dm
from .withreadme import (RESULTS, REVISIONOF, SCRIPTS, SOURCES, WithREADME,
......@@ -42,6 +39,9 @@ class SimulationCFood(AbstractFileCFood, WithREADME):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
WithREADME.__init__(self)
self.people = None
self.project = None
self.simulation = None
def collect_information(self):
self.find_referenced_files([RESULTS, SOURCES, SCRIPTS])
......
......@@ -17,20 +17,16 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
from itertools import chain
import caosdb as db
from caosadvancedtools.cfood import (AbstractFileCFood, assure_has_parent,
from caosadvancedtools.cfood import (AbstractFileCFood,
assure_has_property, assure_name_is,
assure_object_is_in_list, get_entity)
assure_object_is_in_list,
)
from caosadvancedtools.guard import global_guard as guard
from caosadvancedtools.read_md_header import get_header
from .generic_pattern import full_pattern
from .utils import get_files_referenced_by_field, parse_responsibles
from .utils import parse_responsibles
from .withreadme import BINARIES
from .withreadme import DATAMODEL as dm
from .withreadme import SOURCECODE, WithREADME
......
......@@ -26,7 +26,6 @@ import pandas as pd
from caosadvancedtools.cfood import assure_object_is_in_list, fileguide
from caosadvancedtools.utils import (find_records_that_reference_ids,
read_field_as_list,
return_field_or_property,
string_to_person)
logger = logging.getLogger("caosadvancedtools")
......
......@@ -26,8 +26,7 @@ import caosdb as db
from caosadvancedtools.cfood import (assure_has_description, assure_has_parent,
assure_object_is_in_list, fileguide)
from caosadvancedtools.read_md_header import get_header as get_md_header
from caosadvancedtools.table_importer import (win_path_converter,
win_path_list_converter)
from caosadvancedtools.table_importer import (win_path_converter)
from caosadvancedtools.utils import return_field_or_property
from .utils import (get_entity_ids_from_include_file,
......@@ -236,7 +235,7 @@ class WithREADME(object):
generic_references,
record,
prop_name,
to_be_updated=self.to_be_updated,
to_be_updated=self.to_be_updated, # pylint: disable=no-member
datatype=db.LIST(db.REFERENCE),
)
......
......@@ -223,6 +223,7 @@ def init_data_model(entities):
"be a {}.".format(e.role, local_role))
raise DataModelError(e.name, info)
except db.exceptions.EntityDoesNotExistError:
# pylint: disable=raise-missing-from
raise DataModelError(e.name, "This entity does not exist.")
return True
......@@ -246,7 +247,7 @@ def get_data(filename, default=None):
Data from the given file.
"""
result = default.copy() if default is not None else {}
with open(filename, 'r') as fi:
with open(filename, mode="r", encoding="utf-8") as fi:
data = json.load(fi)
result.update(data)
......
......@@ -269,8 +269,8 @@ class TableTemplateGenerator(ABC):
class XLSXTemplateGenerator(TableTemplateGenerator):
"""Class for generating XLSX tables from json schema definitions."""
def __init__(self):
pass
# def __init__(self):
# super().__init__()
def generate(self, schema: dict, foreign_keys: dict, filepath: str) -> None:
"""Generate a sheet definition from a given JSON schema.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment