mxcubecore 1.387.0__py3-none-any.whl → 1.388.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mxcubecore might be problematic. Click here for more details.

@@ -79,7 +79,11 @@ _instance = None
79
79
  TIMERS = []
80
80
 
81
81
  beamline = None
82
- BEAMLINE_CONFIG_FILE = "beamline_config.yml"
82
+ #
83
+ # Supported beamline configuration filenames.
84
+ # The first name in the list takes precedence.
85
+ #
86
+ BEAMLINE_CONFIG_FILES = ["beamline.yaml", "beamline_config.yml"]
83
87
 
84
88
 
85
89
  def load_from_yaml(
@@ -394,8 +398,16 @@ def init_hardware_repository(
394
398
  logging.getLogger("HWR").info("Hardware repository: %s", configuration_path)
395
399
  _instance = __HardwareRepositoryClient(configuration_path)
396
400
  _instance.connect()
401
+
402
+ beamline_config_file = _instance.find_beamline_config_file()
403
+ if beamline_config_file.endswith(".yml"):
404
+ warn( # noqa: B028 we don't care about stacklevel for this warning
405
+ f"Config file '{beamline_config_file}' have deprecated extension 'yml', "
406
+ "change to 'yaml'."
407
+ )
408
+
397
409
  beamline = load_from_yaml(
398
- BEAMLINE_CONFIG_FILE,
410
+ beamline_config_file,
399
411
  role="beamline",
400
412
  yaml_export_directory=yaml_export_directory,
401
413
  )
@@ -455,6 +467,21 @@ class __HardwareRepositoryClient:
455
467
  finally:
456
468
  self.__connected = True
457
469
 
470
+ def find_beamline_config_file(self) -> str | None:
471
+ """Find beamline configuration file name.
472
+
473
+ Look in the repository paths for beamline config file.
474
+
475
+ Returns:
476
+ The found config file name, or None if not found.
477
+ """
478
+ for file_name in BEAMLINE_CONFIG_FILES:
479
+ file = self.find_in_repository(file_name)
480
+ if file is not None:
481
+ return Path(file).name
482
+
483
+ return None
484
+
458
485
  def find_in_repository(self, relative_path):
459
486
  """Finds absolute path of a file or directory matching relativePath
460
487
  in one of the hardwareRepository directories
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mxcubecore
3
- Version: 1.387.0
3
+ Version: 1.388.0
4
4
  Summary: Core libraries for the MXCuBE application
5
5
  License: LGPL-3.0-or-later
6
6
  Keywords: mxcube,mxcube3,mxcubecore
@@ -427,7 +427,7 @@ mxcubecore/HardwareObjects/mockup/XrayCentringMockup.py,sha256=b7LTjBL_1EhX4H4CX
427
427
  mxcubecore/HardwareObjects/mockup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
428
428
  mxcubecore/HardwareObjects/mockup/sample.jpg,sha256=7ztjjtAk5c0T2lmJOySAyXjJFFUklKLJnAv4NqdL1y8,81093
429
429
  mxcubecore/HardwareObjects/sample_centring.py,sha256=iAIZn5UiBsxuZMVxtZtAleRRqjcZnUoMT71Mvutn7ng,18922
430
- mxcubecore/HardwareRepository.py,sha256=UIFODCUQZEbXrxgT6W3YQrec2-Q9CVHtdH9RkT8jN4o,37642
430
+ mxcubecore/HardwareRepository.py,sha256=9ndIfoHBbzAXj2k28YHnldJ4iqFYcTdITbAo0EkPe48,38533
431
431
  mxcubecore/Poller.py,sha256=ImsmlvJVutzJSix3Pvr_DNUcPQJZcDSI-LwESjji0rA,5654
432
432
  mxcubecore/TaskUtils.py,sha256=nheMRSsNuYnbH-2yKTPdb1ua6UYAdYBXcYqbDiIHCEY,3891
433
433
  mxcubecore/__init__.py,sha256=0sksNT-0EuQ7AY7EZcDdUqZiQJs9NpVwYGxCpogi-m4,4293
@@ -467,8 +467,8 @@ mxcubecore/utils/conversion.py,sha256=G1bk2Mi2ZwGbZa5pEeiFaKWxhSVXVGqu1L9_SioyUO
467
467
  mxcubecore/utils/qt_import.py,sha256=0lPmqok_oYQZ059kJCq7RWdg490T8YKyRvoZGyWDy4M,14486
468
468
  mxcubecore/utils/tango.py,sha256=vwEVrIrWKEFaeaJUz3xbaC7XWHY8ZeJ-pfcSrTfZPIE,2114
469
469
  mxcubecore/utils/units.py,sha256=Gh7ovTUN00XBMUoyDG5W7akCx1pROL-M6pK2z1ouemg,1361
470
- mxcubecore-1.387.0.dist-info/COPYING,sha256=u-Mc8zCecwyo4YoP8UulmzCiZZ_MmCLROd_NBtOcRj0,35148
471
- mxcubecore-1.387.0.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
472
- mxcubecore-1.387.0.dist-info/METADATA,sha256=Vl_lItAKjN-pNZID9q_MG97AIrHIkckHLOl1MfoQ1ak,4259
473
- mxcubecore-1.387.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
474
- mxcubecore-1.387.0.dist-info/RECORD,,
470
+ mxcubecore-1.388.0.dist-info/COPYING,sha256=u-Mc8zCecwyo4YoP8UulmzCiZZ_MmCLROd_NBtOcRj0,35148
471
+ mxcubecore-1.388.0.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
472
+ mxcubecore-1.388.0.dist-info/METADATA,sha256=c_IqCvulcXDPDDOO6un1_e_3fwHBvW70hHyAEGxkzRk,4259
473
+ mxcubecore-1.388.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
474
+ mxcubecore-1.388.0.dist-info/RECORD,,