diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml index bb5364cc66..e02052deb1 100644 --- a/.github/workflows/coverage_report.yml +++ b/.github/workflows/coverage_report.yml @@ -1,8 +1,9 @@ +%YAML 1.2 --- name: Coverage Report -on: # yamllint disable-line rule:truthy +on: pull_request: types: [opened, reopened, synchronize] paths: @@ -16,45 +17,44 @@ jobs: steps: - # yamllint disable-line rule:indentation - - uses: actions/checkout@v3 - - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - # yamllint disable rule:line-length - run: | - sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev - python -m pip install --upgrade pip - python -m pip install poetry --user - python -m poetry install --extras=tango - # yamllint enable rule:line-length - - - name: Run and write pytest - # yamllint disable rule:line-length - run: | - set -o pipefail - poetry run pytest --cov=mxcubecore --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt - # yamllint enable rule:line-length - - - name: Pytest coverage comment - id: coverage-comment - uses: MishaKav/pytest-coverage-comment@v1.1.40 - with: - repo-token: ${{ secrets.CI_TOKEN }} - pytest-coverage-path: ./pytest-coverage.txt - junitxml-path: ./pytest.xml - report-only-changed-files: true - - - name: Check the output coverage - run: | - echo "Coverage Percantage - ${{ steps.coverage-comment.outputs.coverage }}" - echo "Coverage Warnings - ${{ steps.coverage-comment.outputs.warnings }}" - echo "Coverage Errors - ${{ steps.coverage-comment.outputs.errors }}" - echo "Coverage Failures - ${{ steps.coverage-comment.outputs.failures }}" - echo "Coverage Skipped - ${{ steps.coverage-comment.outputs.skipped }}" - echo "Coverage Tests - ${{ steps.coverage-comment.outputs.tests }}" - echo "Coverage Time - ${{ steps.coverage-comment.outputs.time }}" + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + # yamllint disable rule:line-length + run: | + sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev + python -m pip install --upgrade pip + python -m pip install poetry --user + python -m poetry install --extras=tango + # yamllint enable rule:line-length + + - name: Run and write pytest + # yamllint disable rule:line-length + run: | + set -o pipefail + poetry run pytest --cov=mxcubecore --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt + # yamllint enable rule:line-length + + - name: Pytest coverage comment + id: coverage-comment + uses: MishaKav/pytest-coverage-comment@v1.1.40 + with: + repo-token: ${{ secrets.CI_TOKEN }} + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./pytest.xml + report-only-changed-files: true + + - name: Check the output coverage + run: | + echo "Coverage Percantage - ${{ steps.coverage-comment.outputs.coverage }}" + echo "Coverage Warnings - ${{ steps.coverage-comment.outputs.warnings }}" + echo "Coverage Errors - ${{ steps.coverage-comment.outputs.errors }}" + echo "Coverage Failures - ${{ steps.coverage-comment.outputs.failures }}" + echo "Coverage Skipped - ${{ steps.coverage-comment.outputs.skipped }}" + echo "Coverage Tests - ${{ steps.coverage-comment.outputs.tests }}" + echo "Coverage Time - ${{ steps.coverage-comment.outputs.time }}" diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index 6dba7f6dd6..d058f1b40f 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -1,7 +1,8 @@ +%YAML 1.2 --- name: Create/Update Tag -on: # yamllint disable-line rule:truthy +on: push: branches: - develop @@ -9,93 +10,92 @@ jobs: create-version-tag: runs-on: ubuntu-latest steps: - # yamllint disable-line rule:indentation - - uses: actions/checkout@v3 - with: - token: ${{ secrets.CI_TOKEN }} - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" + - uses: actions/checkout@v3 + with: + token: ${{ secrets.CI_TOKEN }} + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" - - name: Update version - id: update-version - run: | + - name: Update version + id: update-version + run: | + pip install --upgrade pip + pip install poetry + poetry version minor + git config --global user.email "oscarsso@esrf.fr" + git config --global user.name "Marcus Oskarsson" + git add -A + git commit -m "[skip ci] Bumped minor version" + git push -f + poetry build + - name: Publish package to PyPI + id: publish-pacakge + run: | + poetry config pypi-token.pypi ${{ secrets.PYPI }} + poetry publish + - name: Read package version + id: set-tag + # yamllint disable rule:line-length + run: | pip install --upgrade pip - pip install poetry - poetry version minor - git config --global user.email "oscarsso@esrf.fr" - git config --global user.name "Marcus Oskarsson" - git add -A - git commit -m "[skip ci] Bumped minor version" - git push -f - poetry build - - name: Publish package to PyPI - id: publish-pacakge - run: | - poetry config pypi-token.pypi ${{ secrets.PYPI }} - poetry publish - - name: Read package version - id: set-tag - # yamllint disable rule:line-length - run: | - pip install --upgrade pip - pip install toml - echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])') - # yamllint enable rule:line-length + pip install toml + echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])') + # yamllint enable rule:line-length - - name: Check tag exists - id: check-tag-exists - uses: actions/github-script@v6 - env: - TAG: ${{ steps.set-tag.outputs.tag_name }} - with: - github-token: ${{ github.token }} - script: | - // https://github.com/mukunku/tag-exists-action - var exists = 'false'; - try { - const getRefResponse = await github.rest.git.getRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}" - }); + - name: Check tag exists + id: check-tag-exists + uses: actions/github-script@v6 + env: + TAG: ${{ steps.set-tag.outputs.tag_name }} + with: + github-token: ${{ github.token }} + script: | + // https://github.com/mukunku/tag-exists-action + var exists = 'false'; + try { + const getRefResponse = await github.rest.git.getRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}" + }); - if (getRefResponse.status === 200) { - console.log("Tag was found"); - exists = 'true'; - } - } catch(error) { - console.log("Tag was not found"); - } - core.setOutput('exists', exists); + if (getRefResponse.status === 200) { + console.log("Tag was found"); + exists = 'true'; + } + } catch(error) { + console.log("Tag was not found"); + } + core.setOutput('exists', exists); - - name: Update tag - uses: actions/github-script@v6 - if: steps.check-tag-exists.outputs.exists == 'true' - env: - TAG: ${{ steps.set-tag.outputs.tag_name }} - with: - github-token: ${{ github.token }} - script: | - github.rest.git.updateRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", - sha: context.sha - }) + - name: Update tag + uses: actions/github-script@v6 + if: steps.check-tag-exists.outputs.exists == 'true' + env: + TAG: ${{ steps.set-tag.outputs.tag_name }} + with: + github-token: ${{ github.token }} + script: | + github.rest.git.updateRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", + sha: context.sha + }) - - name: Create tag - uses: actions/github-script@v6 - if: steps.check-tag-exists.outputs.exists != 'true' - env: - TAG: ${{ steps.set-tag.outputs.tag_name }} - with: - github-token: ${{ github.token }} - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", - sha: context.sha - }) + - name: Create tag + uses: actions/github-script@v6 + if: steps.check-tag-exists.outputs.exists != 'true' + env: + TAG: ${{ steps.set-tag.outputs.tag_name }} + with: + github-token: ${{ github.token }} + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", + sha: context.sha + }) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index de58543928..821126ea5d 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -1,3 +1,4 @@ +%YAML 1.2 --- @@ -6,9 +7,9 @@ name: "Pages" concurrency: group: "pages" -on: # yamllint disable-line rule:truthy - push: - pull_request: +on: + push: null + pull_request: null jobs: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c839d545c0..8c47bba8a6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,8 +1,9 @@ +%YAML 1.2 --- name: Linting & Code Quality -on: # yamllint disable-line rule:truthy +on: pull_request: types: [opened, reopened, synchronize] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 942cf857d2..5b4da412d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,8 @@ +%YAML 1.2 --- name: Pytest -on: # yamllint disable-line rule:truthy +on: pull_request: types: [opened, reopened, synchronize] paths: diff --git a/.yamllint.yaml b/.yamllint.yaml index 0c45561f37..06666042cf 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -9,3 +9,27 @@ rules: # Match line length to the one set by `black` the Python formatter line-length: max: 88 + + # octal values must start with 0o, numbers may not start with e.g. 01 + # It is simpler, and costs nothing, to disallow values like `010` + # except as quoted strings + octal-values: + forbid-implicit-octal: true + + # This bans implicit nulls, nulls must be explicit. + empty-values: enable + + # With these settings, and `%YAML 1.2` in the file header, we have : + # + # Booleans: true, false + # None: null, Null, NULL + # not-a-number: .NaN, .NAN, .nan + # Infinity: .Inf, .INF, .inf + # Strings: On, ON, Off, OFF, YES, Yes, NO, No + # Disallowed if not quoted: True, TRUE, False, FALSE + # + # Setting `truthy: disabled` would allow the disabled values, as Booleans + # + # If desired, you could ban unquoted infinity and not-a-number by + # float-values: forbind-int: true + # float-values: forbind-nan: true diff --git a/conda-environment-dev.yml b/conda-environment-dev.yml index 9706d51582..c0bb25ca52 100644 --- a/conda-environment-dev.yml +++ b/conda-environment-dev.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- name: mxcubecore diff --git a/mxcubecore/HardwareRepository.py b/mxcubecore/HardwareRepository.py index 926b0f513d..1000c39aff 100644 --- a/mxcubecore/HardwareRepository.py +++ b/mxcubecore/HardwareRepository.py @@ -56,7 +56,7 @@ yaml = YAML(typ="safe", pure=True) # The following are not needed for load, but define the default style. yaml.default_flow_style = False -yaml.indent(mapping=4, sequence=4, offset=2) +yaml.indent(mapping=2, sequence=4, offset=2) __copyright__ = """ Copyright © 2010 - 2020 by MXCuBE Collaboration """ diff --git a/mxcubecore/configuration/alba_xaloc13/beamline_config.yml b/mxcubecore/configuration/alba_xaloc13/beamline_config.yml index c295a750dc..009ab03ec3 100644 --- a/mxcubecore/configuration/alba_xaloc13/beamline_config.yml +++ b/mxcubecore/configuration/alba_xaloc13/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # FIRST DRAFT of ALAB xaloc13 configuration. TO BE EDITED diff --git a/mxcubecore/configuration/embl_hh_p14/beamline_config.yml b/mxcubecore/configuration/embl_hh_p14/beamline_config.yml index ecca0580c9..3a15310f8f 100644 --- a/mxcubecore/configuration/embl_hh_p14/beamline_config.yml +++ b/mxcubecore/configuration/embl_hh_p14/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # FIRST DRAFT of EMBL P14 configuration. TO BE EDITED diff --git a/mxcubecore/configuration/esrf_id30a2/gphl-setup.yml b/mxcubecore/configuration/esrf_id30a2/gphl-setup.yml index 7bf606df4d..79b8d65baa 100644 --- a/mxcubecore/configuration/esrf_id30a2/gphl-setup.yml +++ b/mxcubecore/configuration/esrf_id30a2/gphl-setup.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- _initialise_class: diff --git a/mxcubecore/configuration/esrf_id30a2/gphl-workflow.yml b/mxcubecore/configuration/esrf_id30a2/gphl-workflow.yml index 1a6c337c48..465b973fe0 100644 --- a/mxcubecore/configuration/esrf_id30a2/gphl-workflow.yml +++ b/mxcubecore/configuration/esrf_id30a2/gphl-workflow.yml @@ -1,5 +1,9 @@ +%YAML 1.2 --- +# NB This file should be ignored until the branch is merged back into develop. rhfogh. +# Meanwhile leave the yamllint as it is + # yamllint disable rule:comments-indentation # yamllint disable rule:hyphens # yamllint disable rule:indentation @@ -106,7 +110,7 @@ settings: # File name prefix for workflow log files co.gphl.wf.persistName: wf - # Switch to pass log to stdout. Defaults to True + # Switch to pass log to stdout. Defaults to true # co.gphl.wf.logStdout: false # Properties applied after the java command - syntax as above--> @@ -121,7 +125,7 @@ settings: # co.gphl.wf.procRootCheck: false # Parameters to individual applications - # Switch devMod to True to activate development parameters + # Switch devMod to true to activate development parameters # NB needed as of 20210802 to pass stratcal parameters strategy_type and variant co.gphl.wf.devMode: true # For stratcal configuration switches edit run_stratcal_wrap.py script instead--> diff --git a/mxcubecore/configuration/lnls_manaca/beamline_config.yml b/mxcubecore/configuration/lnls_manaca/beamline_config.yml index 8bafb3c7b1..34be52f048 100644 --- a/mxcubecore/configuration/lnls_manaca/beamline_config.yml +++ b/mxcubecore/configuration/lnls_manaca/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters @@ -127,12 +128,12 @@ acquisition_limit_values: - 240.0 available_methods: - datacollection: True # yamllint disable-line rule:truthy - characterisation: True # yamllint disable-line rule:truthy - helical: True # yamllint disable-line rule:truthy - xrf_scan: True # yamllint disable-line rule:truthy - energy_scan: True # yamllint disable-line rule:truthy - mesh_scan: fals + datacollection: true + characterisation: true + helical: true + xrf_scan: true + energy_scan: true + mesh_scan: false undulators: - type: PPU35C_GAP diff --git a/mxcubecore/configuration/lnls_sol/beamline_config.yml b/mxcubecore/configuration/lnls_sol/beamline_config.yml index 3b0e0734b7..86c7649389 100644 --- a/mxcubecore/configuration/lnls_sol/beamline_config.yml +++ b/mxcubecore/configuration/lnls_sol/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters @@ -127,12 +128,12 @@ acquisition_limit_values: - 240.0 available_methods: - datacollection: True # yamllint disable-line rule:truthy - characterisation: True # yamllint disable-line rule:truthy - helical: True # yamllint disable-line rule:truthy - xrf_scan: True # yamllint disable-line rule:truthy - energy_scan: True # yamllint disable-line rule:truthy - mesh_scan: fals + datacollection: true + characterisation: true + helical: true + xrf_scan: true + energy_scan: true + mesh_scan: false undulators: - type: PPU35C_GAP diff --git a/mxcubecore/configuration/mockup/gphl/gphl-setup.yml b/mxcubecore/configuration/mockup/gphl/gphl-setup.yml index e5dbf16884..fa7c27980d 100644 --- a/mxcubecore/configuration/mockup/gphl/gphl-setup.yml +++ b/mxcubecore/configuration/mockup/gphl/gphl-setup.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- class: mxcubecore.HardwareObjects.Gphl.GphlWorkflowConnection.GphlWorkflowConnection diff --git a/mxcubecore/configuration/mockup/gphl/gphl-workflow.yml b/mxcubecore/configuration/mockup/gphl/gphl-workflow.yml index 080c9ac9c2..21efb21ab6 100644 --- a/mxcubecore/configuration/mockup/gphl/gphl-workflow.yml +++ b/mxcubecore/configuration/mockup/gphl/gphl-workflow.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- class: mxcubecore.HardwareObjects.Gphl.GphlWorkflow.GphlWorkflow @@ -48,7 +49,7 @@ configuration: # NB to get sensible results you should use the default values for resolution and # wavelength, and the default Eiger 16M detector # Otherwise the UI may still work, but the indexing solutions will be weird - # use_preset_spotdir: True + # use_preset_spotdir: true defaults: @@ -99,8 +100,8 @@ configuration: # Multiple acquisitions in order - characterisation then main # passed to set_pre_strategy_params and set_pre_acquisition_params # NB as long as we only acquire either characterisation+main or diffractcal - # the code will use list[0] for the first acquisition and - # list[-1] for the main one + # the code will use list[0] for the first acquisition + # and list[-1] for the main one auto_acq_parameters: # For characterisation acquisition - exposure_time: 0.02 @@ -124,14 +125,14 @@ configuration: wedge_width: 15.0 strategy: full repetition_count: 1 - strategy_options: - # Program options passed directly to stratcal - not needed normally - # Override default settings - # angular_tolerance, maximum_chi, and clip_kappa are defined in - # settings (above) and strategy_type and variant by program - # maximum_chi: 48.0 - # angular_tolerance: 1.0 - # option_name: 999.999 + # strategy_options: + # Program options passed directly to stratcal - not needed normally + # Override default settings + # angular_tolerance, maximum_chi, and clip_kappa are defined in + # settings (above) and strategy_type and variant by program + # maximum_chi: 48.0 + # angular_tolerance: 1.0 + # option_name: 999.999 # Java invocation properties - syntax is e.g. '-Dfile.encoding=UTF-8' invocation_properties: @@ -139,7 +140,7 @@ configuration: # File name prefix for workflow log files co.gphl.wf.persistName: wf - # Switch to pass log to stdout. Defaults to True + # Switch to pass log to stdout. Defaults to true # co.gphl.wf.logStdout: false # Properties applied after the java command - syntax as above--> @@ -157,7 +158,7 @@ configuration: # co.gphl.wf.procRootCheck: false # Parameters to individual applications - # Switch devMod to True to activate development parameters + # Switch devMod to true to activate development parameters # NB needed as of 20231116 no longer in active use # co.gphl.wf.devMode: true # For stratcal configuration switches edit run_stratcal_wrap.py script instead diff --git a/mxcubecore/configuration/mockup/gphl/gphl_wf_automation_interface.yml b/mxcubecore/configuration/mockup/gphl/gphl_wf_automation_interface.yml index 0f079030ca..e2074de049 100644 --- a/mxcubecore/configuration/mockup/gphl/gphl_wf_automation_interface.yml +++ b/mxcubecore/configuration/mockup/gphl/gphl_wf_automation_interface.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- ### Calling interface (for automation) @@ -11,110 +12,110 @@ task: -parameters: - # Process control and ??? - wfpath: Gphl # Mandatory – specifies GΦL workflow - automation_mode: MASSIF1 # Optional, defaults to None (manual) - shape: some_shape_name # Used for EDNA workflow, I do not know what for + parameters: + # Process control and ??? + wfpath: Gphl # Mandatory – specifies GΦL workflow + automation_mode: MASSIF1 # Optional, defaults to None (manual) + shape: some_shape_name # Used for EDNA workflow, I do not know what for - # Strategy control - strategy_name: "Native data collection" # (str) Mandatory. - # Options are: ‘Native data collection’, ‘Phasing (SAD)’ - # ‘Two-wavelength MAD’, ‘Three-wavelength MAD’, ‘Diffractometer calibration’ + # Strategy control + strategy_name: "Native data collection" # (str) Mandatory. + # Options are: ‘Native data collection’, ‘Phasing (SAD)’ + # ‘Two-wavelength MAD’, ‘Three-wavelength MAD’, ‘Diffractometer calibration’ - # directory and file names. All optional, default to session default - # See File Locations in manual - prefix: # (str) - suffix: # (str) Optional - subdir: # (str) Optional + # directory and file names. All optional, default to session default + # See File Locations in manual + prefix: # (str) + suffix: # (str) Optional + subdir: # (str) Optional - # Optional, overriding configured defaults: - decay_limit: 25 # (%). - # Minimum % intensity remaining at target resolution using recommended dose budget - # dose_budget = 2 * resolution**2 * log(100. / decay_limit) / relative_sensitivity - maximum_dose_budget: 20 # (MGy). Maximum when calculating budget from resolution - characterisation_budget_fraction: 0.05 # dose fraction used for characterisation + # Optional, overriding configured defaults: + decay_limit: 25 # (%). + # Minimum % intensity remaining at target resolution using recommended dose budget + # dose_budget = 2 * resolution**2 * log(100. / decay_limit) / relative_sensitivity + maximum_dose_budget: 20 # (MGy). Maximum when calculating budget from resolution + characterisation_budget_fraction: 0.05 # dose fraction used for characterisation - # Strategy name, matching strategylib.nml. - auto_acq_parameters: # (list of dict) automation parameters for acquisitions. - # Optional. - # The standard workflows have two acquisitions, characterisation and main; - # diffractometer calibration has only one, and future workflows may have more. - # The dictionaries are applied to the acquisitions in order; - # if there is only one dictionary in the list, it applies to all acquisitions. - # The following appear in task dictionaries in interactive MXCuBE3, - # but are NOT used by the GΦL workflow: wfname, wftype, strategies, type + # Strategy name, matching strategylib.nml. + auto_acq_parameters: # (list of dict) automation parameters for acquisitions. + # Optional. + # The standard workflows have two acquisitions, characterisation and main; + # diffractometer calibration has only one, and future workflows may have more. + # The dictionaries are applied to the acquisitions in order; + # if there is only one dictionary in the list, it applies to all acquisitions. + # The following appear in task dictionaries in interactive MXCuBE3, + # but are NOT used by the GΦL workflow: wfname, wftype, strategies, type - # The first dictionary are the parameters needed for MASSIF1 characterisation - # where characterisation and first XDS run are done BEFORE starting the workflow - # init_spot_dir can be set ONLY for characterisation - # init_spot_dir, if set, turns off the workflow-driven characterisation - # resolution, energies, and transmission are taken from the current values - # in this case unless explicitly set - - exposure_time: 0.04 # (s) Optional, default configured. - # Mandatory if init_spot_dir is set - image_width: 0.1 # (°) Optional, default configured. - # Mandatory if init_spot_dir is set - # use_dose: 20.0 # (MGy) Total dose. Optional. Overrides dose budget - # transmission: 100.0 # (%) Nptional Overrides use_dose. - # Defaults to current valuee if init_spot_dir is set - init_spot_dir: "/where/ever/dict" # Directory containing SPOTS.XDS file - # from preliminary XDS calculation - # When init_spot_dir is set, strategy must be the name of the strategy - # (specified in stragegylib.nml) that was actually used for characterisation. - strategy: “Char_6_5_multitrigger” - # Optional: Arithmetic crystal classes expected for the symmetry. - # Will be used to select a matching indexing solution, - # and to determine acquisition strategy. - # If no matching indexing solution is found, these will be ignored. - # Must be given in first (characterisation) set of auto_acq_parameters - # crystal_classes: - # - 4I - # - 422I - # Pass input cell and symmetry to XDS and processing and force their use as - # starting point. Used to override XDS cell, symmetry determination - use_cell_for_processing: false + # The first dictionary are the parameters needed for MASSIF1 characterisation + # where characterisation and first XDS run are done BEFORE starting the workflow + # init_spot_dir can be set ONLY for characterisation + # init_spot_dir, if set, turns off the workflow-driven characterisation + # resolution, energies, and transmission are taken from the current values + # in this case unless explicitly set + - exposure_time: 0.04 # (s) Optional, default configured. + # Mandatory if init_spot_dir is set + image_width: 0.1 # (°) Optional, default configured. + # Mandatory if init_spot_dir is set + # use_dose: 20.0 # (MGy) Total dose. Optional. Overrides dose budget + # transmission: 100.0 # (%) Nptional Overrides use_dose. + # Defaults to current valuee if init_spot_dir is set + init_spot_dir: "/where/ever/dict" # Directory containing SPOTS.XDS file + # from preliminary XDS calculation + # When init_spot_dir is set, strategy must be the name of the strategy + # (specified in stragegylib.nml) that was actually used for characterisation. + strategy: “Char_6_5_multitrigger” + # Optional: Arithmetic crystal classes expected for the symmetry. + # Will be used to select a matching indexing solution, + # and to determine acquisition strategy. + # If no matching indexing solution is found, these will be ignored. + # Must be given in first (characterisation) set of auto_acq_parameters + # crystal_classes: + # - 4I + # - 422I + # Pass input cell and symmetry to XDS and processing and force their use as + # starting point. Used to override XDS cell, symmetry determination + use_cell_for_processing: false - # acquisition parameters, for successive steps (characterisation or main). - # This example lists all options, for documentation purposes - # All are optional (except when init_spot_dir is set) and should normally - # be left empty so the default is used. - - resolution: 1.7 # (Å) Optional. Defaults to current value, - # or to diffraction plan aimed_resolution - energies: (12.4,) # tuple(keV) List of energies to use in experiment. - # two or three for MAD (only). - # First wavelength will be used for calculating strategies, dose budget, etc. - # Optional, except for MAD - will default to current beamline energy. - exposure_time: 0.04 # (s) Optional, default configured. - # Mandatory if init_spot_dir is set - image_width: 0.1 # (°) Optional, default configured. - # Mandatory if init_spot_dir is set - wedge_width: 30.0 # (°) Wedge width (for interleaving) - # Optional, default configured. - snapshot_count: 2 # Optional, default configured. - use_dose: 20.0 # (MGy) NB Optional, for entire experiment. - # Defaults to calculated dose budget. Resets transmission, exposure time - transmission: 80.0 # (%) NB Optional Overrides use_dose. - # Defaults to current valuee if init_spot_dir is set - # Otherwise is set from dose budget and resolution. - # If set this value will reset the dose budget - # Strategy variant - # Default is “quick” for MAD, “full” for native or SAD - strategy: full - # Number of repetitions of entire strategy - repetition_count: 1 - # Pass input cell and symmetry to XDS and processing and force their use as - # startign point. Used to override XDS cell, symmetry determination - use_cell_for_processing: false + # acquisition parameters, for successive steps (characterisation or main). + # This example lists all options, for documentation purposes + # All are optional (except when init_spot_dir is set) and should normally + # be left empty so the default is used. + - resolution: 1.7 # (Å) Optional. Defaults to current value, + # or to diffraction plan aimed_resolution + energies: (12.4,) # tuple(keV) List of energies to use in experiment. + # two or three for MAD (only). + # First wavelength will be used for calculating strategies, dose budget, etc. + # Optional, except for MAD - will default to current beamline energy. + exposure_time: 0.04 # (s) Optional, default configured. + # Mandatory if init_spot_dir is set + image_width: 0.1 # (°) Optional, default configured. + # Mandatory if init_spot_dir is set + wedge_width: 30.0 # (°) Wedge width (for interleaving) + # Optional, default configured. + snapshot_count: 2 # Optional, default configured. + use_dose: 20.0 # (MGy) NB Optional, for entire experiment. + # Defaults to calculated dose budget. Resets transmission, exposure time + transmission: 80.0 # (%) NB Optional Overrides use_dose. + # Defaults to current valuee if init_spot_dir is set + # Otherwise is set from dose budget and resolution. + # If set this value will reset the dose budget + # Strategy variant + # Default is “quick” for MAD, “full” for native or SAD + strategy: full + # Number of repetitions of entire strategy + repetition_count: 1 + # Pass input cell and symmetry to XDS and processing and force their use as + # startign point. Used to override XDS cell, symmetry determination + use_cell_for_processing: false - strategy_options: # (dict) strategy calculation parameters. See below + strategy_options: # (dict) strategy calculation parameters. See below - # strategy options. Control the stratcal strategy calculation program. - # maximum_chi is automaticaly reduced to match kappa motor limits. - maximum_chi: 48.0 # (°) Optional. Maximum chi value allowed for strategies. - # Default 48 - angular tolerance: 1.0 # (°) Optional. - # Tolerance to distinguish strategy orientations + # strategy options. Control the stratcal strategy calculation program. + # maximum_chi is automaticaly reduced to match kappa motor limits. + maximum_chi: 48.0 # (°) Optional. Maximum chi value allowed for strategies. + # Default 48 + angular tolerance: 1.0 # (°) Optional. + # Tolerance to distinguish strategy orientations # Other parameters are set (ultimately) from ISPyB. These are all optional: # From crystal description: diff --git a/mxcubecore/configuration/mockup/gphl/gphl_wf_test_parameters.yml b/mxcubecore/configuration/mockup/gphl/gphl_wf_test_parameters.yml index cc1ee042ad..c3006e8a6d 100644 --- a/mxcubecore/configuration/mockup/gphl/gphl_wf_test_parameters.yml +++ b/mxcubecore/configuration/mockup/gphl/gphl_wf_test_parameters.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- ### Calling interface (for automation) @@ -79,7 +80,7 @@ task: # relative_rad_sensitivity: 1.0 # default value 1.0 # Pass input cell and symmetry to XDS and processing and force their use as # starting point. Used to override XDS cell, symmetry determination - # use_cell_for_processing: False # default value False + # use_cell_for_processing: false # default value false exposure_time: 0.04 # (s) Optional, default configured. # Mandatory if init_spot_dir is set image_width: 0.1 # (°) Optional, default configured. @@ -116,7 +117,7 @@ task: # maximum_chi: 48.0 # Pass input cell and symmetry to XDS and processing and force their use as # starting point. Used to override XDS cell, symmetry determination - # use_cell_for_processing: False # default value False + # use_cell_for_processing: false # default value false exposure_time: 0.04 # (s) Optional, default configured. # Mandatory if init_spot_dir is set image_width: 0.1 # (°) Optional, default configured. @@ -128,8 +129,7 @@ task: # Defaults to calculated dose budget. May reset transmission and exposure time # repetition_count: 1 # snapshot_count: 2 - # yamllint disable-line rule:truthy - skip_collection: True # Causes GPhL collection simulation (only!) to do nothing + skip_collection: true # Causes GPhL collection simulation (only!) to do nothing # Other parameters are set (ultimately) from ISPyB. These are all optional: # From crystal description: diff --git a/mxcubecore/configuration/mockup/procedure-mockup.yml b/mxcubecore/configuration/mockup/procedure-mockup.yml index 42025fe712..4df2475f85 100644 --- a/mxcubecore/configuration/mockup/procedure-mockup.yml +++ b/mxcubecore/configuration/mockup/procedure-mockup.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters diff --git a/mxcubecore/configuration/mockup/qt/beamline_config.yml b/mxcubecore/configuration/mockup/qt/beamline_config.yml index 0538c29e31..cef09b5c76 100644 --- a/mxcubecore/configuration/mockup/qt/beamline_config.yml +++ b/mxcubecore/configuration/mockup/qt/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters @@ -93,8 +94,8 @@ configuration: characterisation: # Defaults for chareacterisation. Missing values are taken from default osc_range: 1 - opt_sad: False # yamllint disable-line rule:truthy - account_rad_damage: True # yamllint disable-line rule:truthy + opt_sad: false + account_rad_damage: true strategy_complexity: 0 max_crystal_vdim: 1.0 min_crystal_vdim: 1.0 diff --git a/mxcubecore/configuration/mockup/test/beamline_config.yml b/mxcubecore/configuration/mockup/test/beamline_config.yml index 1b7182260b..f5d6a7752d 100644 --- a/mxcubecore/configuration/mockup/test/beamline_config.yml +++ b/mxcubecore/configuration/mockup/test/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters diff --git a/mxcubecore/configuration/mockup/web/beamline_config.yml b/mxcubecore/configuration/mockup/web/beamline_config.yml index 274f3958c3..f41aa654b2 100644 --- a/mxcubecore/configuration/mockup/web/beamline_config.yml +++ b/mxcubecore/configuration/mockup/web/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # The class to initialise, and init parameters @@ -92,8 +93,8 @@ default_acquisition_parameters: characterisation: # Defaults for chareacterisation. Missing values are taken from default osc_range: 1 - opt_sad: False # yamllint disable-line rule:truthy - account_rad_damage: True # yamllint disable-line rule:truthy + opt_sad: false + account_rad_damage: true strategy_complexity: 0 strategy_program: Optimal max_crystal_vdim: 1.0 diff --git a/mxcubecore/configuration/mockup/xray_centring2.yml b/mxcubecore/configuration/mockup/xray_centring2.yml index cdb2fa3355..d596e54160 100644 --- a/mxcubecore/configuration/mockup/xray_centring2.yml +++ b/mxcubecore/configuration/mockup/xray_centring2.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- class: mxcubecore.HardwareObjects.mockup.XrayCentringMockup.XrayCentringMockup diff --git a/mxcubecore/configuration/soleil_px1/beamline_config.yml b/mxcubecore/configuration/soleil_px1/beamline_config.yml index 227f132b66..081813c54d 100644 --- a/mxcubecore/configuration/soleil_px1/beamline_config.yml +++ b/mxcubecore/configuration/soleil_px1/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # FIRST DRAFT of SOLEIL px1 configuration. TO BE EDITED diff --git a/mxcubecore/configuration/soleil_px2/beamline_config.yml b/mxcubecore/configuration/soleil_px2/beamline_config.yml index 7606024945..287bc8a84a 100644 --- a/mxcubecore/configuration/soleil_px2/beamline_config.yml +++ b/mxcubecore/configuration/soleil_px2/beamline_config.yml @@ -1,3 +1,4 @@ +%YAML 1.2 --- # FIRST DRAFT of SOLEIL px2 configuration. TO BE EDITED diff --git a/mxcubecore/model/queue_model_objects.py b/mxcubecore/model/queue_model_objects.py index 08a93109fd..ee9202ac45 100644 --- a/mxcubecore/model/queue_model_objects.py +++ b/mxcubecore/model/queue_model_objects.py @@ -38,7 +38,7 @@ yaml = YAML(typ="safe", pure=True) # The following are not needed for load, but define the default style. yaml.default_flow_style = False - yaml.indent(mapping=4, sequence=4, offset=2) + yaml.indent(mapping=2, sequence=4, offset=2) except Exception: logging.getLogger("HWR").warning( "Cannot import dependenices needed for GPHL workflows - GPhL workflows might not work"