diff --git a/pyproject.toml b/pyproject.toml index f6935d6..4c2e086 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,3 +7,6 @@ build-backend = "setuptools.build_meta" # For smarter version schemes and other configuration options, # check out https://github.com/pypa/setuptools_scm version_scheme = "no-guess-dev" + +[tool.pytest.ini_options] +addopts = "--no-cov" diff --git a/src/cristallina/utils.py b/src/cristallina/utils.py index 1189d09..c5068d4 100644 --- a/src/cristallina/utils.py +++ b/src/cristallina/utils.py @@ -1,5 +1,8 @@ import yaml import os +import logging +logger = logging.getLogger() + import numpy as np from sfdata import SFDataFiles, sfdatafile, SFScanInfo, SFProcFile from xraydb import material_mu @@ -152,11 +155,12 @@ class ROI: else: raise ValueError("No valid ROI definition.") - # Check that ROI has a name and assign it - if name: - self.name = name - else: - raise ValueError('ROI must have a name. Please provide with name=... as a parameter') + # Check that ROI has a name or generate default + if name is None: + logger.warning(f"No ROI name given, generating: {self.__repr__()}") + name = self.__repr__() + + self.name = name def from_centers_widths(self, center_x, center_y, width, height): self.left = center_x - width // 2