Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring ISPyBClientMockup for authnentication tests #1066

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

dominikatrojanowska
Copy link
Contributor

@dominikatrojanowska dominikatrojanowska commented Oct 31, 2024

The PR is dependent on this one.
The change provided here allows to perform correctly authentication tests that are using CREDENTIALS_1: https://github.com/mxcube/mxcubeweb/blob/develop/test/test_authn.py#L24

@fabcor-maxiv fabcor-maxiv merged commit d549fac into mxcube:develop Oct 31, 2024
9 checks passed
@marcus-oscarsson
Copy link
Member

Thanks

@marcus-oscarsson
Copy link
Member

I'm sorry guys but there is an issue with this code:

get_proposal at this line https://github.com/mxcube/mxcubecore/pull/1066/files#diff-49fa365d70805e215a94138cdd0f725d690114c71b0c7cf53e1ab6d10d055e5fR125 will always return the same proposal regardless of login used.

Hence logging-in with idtest1 returns the proposal of idtest0, right ? This means that the tests for mxcubeweb will fail. If you agree I will disable this test in mxcubeweb for the moment and then you can have a closer look at returning the right proposal (when you get some time)

fhernandezvivanco added a commit to AustralianSynchrotron/mxcubecore that referenced this pull request Dec 3, 2024
* [skip ci] Bumped minor version

* Bump certifi from 2023.5.7 to 2024.7.4

Bumps [certifi](https://github.com/certifi/python-certifi) from 2023.5.7 to 2024.7.4.
- [Commits](certifi/python-certifi@2023.05.07...2024.07.04)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* [skip ci] Bumped minor version

* Added removed logging module. Sample loading was not possible.

* [skip ci] Bumped minor version

* Improved yaml linting and tightened config. Set YAML 1.2 everywhere

* Cleaned up yaml linting, and added `%YAML 1.2` lines

* Moved %YAML directive back to `%YAML 1.2` without #'

* Fixed yamllint problems

* Removed `%YAML 1.2` from .githib/workflows files

* Put "on:" in quotes in .github/workflows to pass yamllint

* Fixed yamllint complaint about  indented comments

* Reorganised comments for yamllint

* [skip ci] Bumped minor version

* Bump zipp from 3.15.0 to 3.19.1

Bumps [zipp](https://github.com/jaraco/zipp) from 3.15.0 to 3.19.1.
- [Release notes](https://github.com/jaraco/zipp/releases)
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
- [Commits](jaraco/zipp@v3.15.0...v3.19.1)

---
updated-dependencies:
- dependency-name: zipp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* [skip ci] Bumped minor version

* Attempt to solve issue 902 (mxcube#940)

* Removed Device and Equipment objects and replaced them with HardwareObject

* Removed Device and Equipment objects and replaced them with HardwareObject for configuration files

* Fixed ISARA test

* Fixed device_uri tags

* [skip ci] Bumped minor version

* Bump setuptools from 67.8.0 to 70.0.0 (mxcube#973)

Bumps [setuptools](https://github.com/pypa/setuptools) from 67.8.0 to 70.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v67.8.0...v70.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [skip ci] Bumped minor version

* CatsMaintMockup: fix call to super __init__() (mxcube#976)

The CatsMaintMockup does not inherit Equipment class anymore.

* [skip ci] Bumped minor version

* remove import of devtools

Don't import devtools module for the test collection queue entry.
Mxcube-core does not list devtools package as a dependency.

Also remove unused import of HardwareRepository.

* [skip ci] Bumped minor version

* MAXIV: new common HWO for machine information

New MachInfo hardware object, for using at BioMAX and MicroMAX.

Based on older HWO used at BioMAX, but updated to follow the
new AbstractMachineInfo API.

* [skip ci] Bumped minor version

* support python 3.11

 - mark python 3.11.* as supported for this package.
 - require later version of greenlet package, as version 1.1.3
   does not work with python 3.11.
 - require later versions of gevent and gipc packages, to statisfy
   greenlet 3.* requirmets.

* [skip ci] Bumped minor version

* Deprecating Device and Equipment

* Added deprecation warning to __init_subclass__

* [skip ci] Bumped minor version

* CI: run pytests on package version changes

Trigger pytest if project definition or poetry lock is updated.

Make sure that we test the (potentially) new versions of dependency
packages.

* [skip ci] Bumped minor version

* GenericNState to define get_value and _set_value with no action.

* Index in the value_to_enum tuple can be any, not just 0.
default_value should be an Enum, but impossible be set as such in the configuration file

* Bug fix.

* Add possibility to get the checkbeam status from GenericNState HO.
Status can be changed by the beamline actions.

* Change check to monitor to avoid confusion.Remove obsolete check_flux.

* Change the name to NState.

* Default value can be False or 0.

* [skip ci] Bumped minor version

* extra attrs for xrf spectrum dict; file suffix as optional property

* [skip ci] Bumped minor version

* Update limits when wavelength changes.

* [skip ci] Bumped minor version

* Allow `.yaml` extension for YAML config files

The recommended file extension for YAML files is `.yaml`.
Both `.yaml` and `.yml` are valid extensions for YAML files.

* [skip ci] Bumped minor version

* XRF centred position (mxcube#988)

* propagate xrf centred position

retrive xrf cpos from shape

typo

xrf model knows about shape

* propagate energy scan centred position

* [skip ci] Bumped minor version

* Fixed calls to super class for objects that used to use Device or Equipment

* [skip ci] Bumped minor version

* Beam refactoring - definer and size  (former Aperture as NState) (mxcube#919)

* Aperture from AbstractNState implementation.

* Change BeamMockup accordingly.

* Start using HO from beam_definer branch.

* Fix bug.

* Black

* Add _definer_type property.Fix typo for elliptical.Documentation.

* Add beam definer (as started in beam_definer branch).

* Add beam size methods.Minor cleanup

* beam_test change

* black

* black

* Again?

* Size is in mm

* Black again.

---------

Co-authored-by: Antonia Beteva <beteva@debian8-devel.esrf.fr>

* [skip ci] Bumped minor version

* Rename Oxford700 to OxfordCryostream (handles all models).
Add temperature monitoring feature.

* Remove the temperature polling - now handled in the cryostream HO

* [skip ci] Bumped minor version

* ESRF Implementation of new beam size and definer handling

* Remove obsolete code.

* [skip ci] Bumped minor version

* Replaced the use of a few remaining Device with HardwareObject

* [skip ci] Bumped minor version

* Moved set_is_ready method from Device to HardwareObject and added deprecation warning

* [skip ci] Bumped minor version

* Fixed bugs related to recent Beamdefiner changes

* Removed commented-out line

* Updated doc strings to allow for latest change

* Removed commented-out line

* [skip ci] Bumped minor version

* Fix bug in BeamMockup and test_beam (mxcube#1006)

Co-authored-by: Antonia Beteva <beteva@debian8-devel.esrf.fr>

* [skip ci] Bumped minor version

* hwobj-ify abstract energy scan (mxcube#1008)

* [skip ci] Bumped minor version

* extra attrs for xrf spectrum dict revert (mxcube#1005)

* Remove prefix, spectrum_directory and archive_directory from spectrum_info_dict

* Camel to snake case.

---------

Co-authored-by: Antonia Beteva <beteva@debian8-devel.esrf.fr>

* [skip ci] Bumped minor version

* Bump opencv-python from 4.7.0.72 to 4.8.1.78

Bumps [opencv-python](https://github.com/opencv/opencv-python) from 4.7.0.72 to 4.8.1.78.
- [Release notes](https://github.com/opencv/opencv-python/releases)
- [Commits](https://github.com/opencv/opencv-python/commits)

---
updated-dependencies:
- dependency-name: opencv-python
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* [skip ci] Bumped minor version

* fix initialization of EnergyScanMockup

In 1350c66 commit, the
AbstractEnergyScan class has been changed to extend HardwareObject.
It's AbstractEnergyScan.__init__() method now takes a string
parameter. This change breaks current EnergyScanMockup.__init__()
method, as it calls AbstractEnergyScan.__init__() without any
arguments.

Remove the EnergyScanMockup.__init__() method, as it's no longer
needed. This fixes the issue with creating EnergyScanMockup objects.

* [skip ci] Bumped minor version

* fix wording in some doc strings

Fix typos and spelling style in some python doc strings.

* add missing . in the documentation

* remove confusing class doc string

The doc string for DataCollection seems to be talking about
something different then the DataCollection class. Probably some
kind of refactoring accident.

* remove duplicate import

* remove unused imports

* remove commented out code

It's been commented a long time ago. I don't think anyone is
going to miss it now.

* remove incorrect type hint

This method returns 'None'.

* fix typos in comment and doc strings

* trim linters exclude lists

Remove files from autoflake and black exclude list, that does not
need to be there.

* [skip ci] Bumped minor version

* fix when static params are not defined

* remove unneeded argument

* a working escan mockup

* [skip ci] Bumped minor version

* allow update grid result data (mxcube#1004)

* allow update grid result data

* allow update grid result data

* document grid result format

* [skip ci] Bumped minor version

* units: add micrometers (μm) to millimeters conversion function

Adds a function to convert micrometers (μm) to millimeters.

* [skip ci] Bumped minor version

* Added comparability between pydantic 1 and 2

* Updated pydantic

* [skip ci] Bumped minor version

* actions: notify teams upon new discussion in category

* [skip ci] Bumped minor version

* [type hint] fix for Python 3.8 incompatible typehints

* [skip ci] Bumped minor version

* Bumped Pydantic to 2.x

* [skip ci] Bumped minor version

* Added workflow parameter IDs for ESRF workflow automation

* Added workflow parameter IDs for ESRF workflow automation, part 2

* Now correct fix for recentring='none' bug

* [skip ci] Bumped minor version

* Bumped pillow

* [skip ci] Bumped minor version

* P11 char (mxcube#966)

* Set energy within the tolerance

* Added handling of progress bar during data collection

* EDNA startup tests at P11

* Added waiting for resulting ENDA xml output for characterisation.

* Black

* Add more explicit omega_wait_on function in P11NanoDiff

* Patched recursion error in MotorsNPositon used at P11.

* Black

* Refactor move motors in P11NanoDiff. Avoid as_dict none error.

* Refactor move motors in P11NanoDiff. Avoid waiting before move is done.

* Refactoring of characterisation. Move MOSFLM to P11EDNACharacterisation. Simplified edna_maxwell()

* EDNA folders check - separate creation of char and rotational dirs (all based on xds_dir).

* Revisit path conversion for EDNA xml

* Updated latest local changes to the EDNA CHaracterisation

* Put the xdsapp start in the separate function

* Added maschine info class (WIP)

* Added flux estimation using tabulated values (temporary plug for EDNA tests)

* Added transmission to the log

* Data processing is fixed by duplicationg h5 header info from the CC

* Added info.txt prototype from CC

* Added function returning string of beam focus for info.txt

* Added writing info.txt similar to CC

* Fixed failing Diffraction plan execution due to the path mismatch

* Beam current simulation for EDNA

* Added get current from mach_info to info.txt

* Cleanup

* Added the reading of machine parameters

* Code cleanup. Adding the filter thickness into the info.txt in mm

* Code cleanup

* Black

* Fix image_interval in info.txt

* Removed debug print

* Removed unused genxdsinp function. Moved to the start script.

* Added additional check for the waiting untill NanoDiff is ready

* Make sure that debug directory is created

* Increased timeout for EDNA output waiting

* Added additional robot actions

* Debug of data collection

* Added explicit wait for teh arm command

* Added maxwell processing for autoproc

* Test debugs

* Increased a bit delay for a debuggingh data collection

* Black

* Black

* Suppress multy wedge data collection (GB) in characterisation

* Added explicit remeasure of the flux for raddose before starting characterisation

* Add writing the info about autoproc for presenterd in datasets.txt

* Addeed writing path to EDNA for presenterd

* Rewverted back the delay to 0.003

* Added prototype for the angle calibration. To be checked with beam.

* Adapted data collection from CC. Moved goniometer-related code to the P11NanoDiff including xml files changes.

* Added additional status check for the detector distance

* Removed function that is now in P11NanoDiff

* Added the changes to make it work again after Device class deprecation (see PR#940 - attemt to solve issue 902)

* Linting

* Change init (PR966)

* Change init in P11Session (PR966)

* Removed Hardwareobject inheritance in MjpgStreamVideo (PR966)

* Removed unnnessesary self.is_ready() after update (PR966)

* Black

* Update of the P11Beam after rebase and update of the AbstractBeam

* Update

* Changes according to the suggestions in PR966

* Removed typo AbstractCollect

* P11Beam updates (PR#966)

* Removed duplicatons (PR#966)

* Moved energy chack logick to P11Energy (PR#966)

* Removed return (PR#966)

* Explicit int() conversion for the mouse click coordinates in teh centring after python 3.10 upgrade

* Removed commented code

* Removed commented code

* Black

* Adressing the function return issue (PR#966)

* Black

* Revovin evaluate_beam_info after properly writing beam sizes as list and not as tuple (PR#966)

* Fixing NanoDiff centring issues

* Reimplemented Maschine Info using TangoMaschineInfo (PR#966)

* Removed the unused code (PR#966)

* Removed the unnessesary line (PR#966)

* Added update_state call after the state is ready

* Added usage of default_values and docstrings update (PR#966)

* Added properly formatted docstrings

* Fixed display of proposal in case ISPyB is not available

* Updated the file header according to the recent py_file_header without dates

* Black and additional header update

* Changed P11Pinhole to use Nstate

* Add P11 beamstop, collimator and yag using NState. To be tested.

* Update of the P11NanoDiff to use get_value instead of _get_positions (migrate MotorsNPosition to Nstate, PR#966)

* Black

* Refactor collimator to be an instance of AbstractNState class (PR#966)

* Added implementation of P11Beamstop as AbstractNState instead of MotorNState PR#966

* Added Diode-Yag stage implementation as AbstractNState (PR#966)

* Corrected P11NanoDiff initially to test reimplemetation of beamline componeneta as AbstractNState

* Removed setting omega to 0 during the centring phase in P11NanoDiff

* Refactoring to use AbstractNState for Pinholes,Yag and Collimator

* Refactoring and corresponding updates in P11NanoDiff to work with new objects

* Linting

* Typo fix in TangoMotor

* Fixed the waiting phase during components move after refactoring (PR#966)

* Fixes of qt-related parts after refactoring PR#966

* Added initial handling of DoorInterlock

* Moved url to the properties

* fixing the write info for screening. Reverting back the line removed during the work on PR#966

* Quick fix for the manual centring for now (reverted). To be investigated.

* Update the MultiNState for revisiting the recursion problem and value return (PR#966).

* Added the py_header info into the files

* Removed phiz from the centring tower movement in P11NanoDiff

* Code cleanup

* Added info comments for the GUI during phase changes

* Cleanup

* Cleanup

* Added position return function to work with qt multi-state brick

* Removed the moving yag down during initialization

* Black

* Added proper logging

* Preliminary update of the MachineInfo to make it work with qt

* Linting

* Modify so it works with qt mach info brick

* P11MachInfo cleanup

* Change to 3s update

* Changes to fix the detector misfires in P11Collect characterisation

* Fixed the unable to start session if the beamtime file is not created - no beamtime.

* P11Session code cleanup

---------

Co-authored-by: Andrey Gruzinov <andrey.gruzinov@desy.de>

* [skip ci] Bumped minor version

* units: add milliseconds (ms) to seconds conversion function

* [skip ci] Bumped minor version

* Prevent mockup value to be set to exception on abort

* [skip ci] Bumped minor version

* [Harvester] FIx typo

FIx EMBLFlexHCD inheritance Object is a module, not a class

* [skip ci] Bumped minor version

* Fixed collect resolution-setting problem

* Code improvements for previous commit

* Put GPhL files under black formatting

* Improve black formatting

* Removed space for black

* Cleaned up for linting

* [skip ci] Bumped minor version

* First attempt to add space group synonyms

* Cleaned up further for linting

* Added extra Space Group synonyms for P2221 and P21212 non-std settings

* Run black

* Run pre-commit, and removed default_language_version

* Removed commented-out section

* Yet another black change

* [skip ci] Bumped minor version

* Update pre-commit hooks

* [skip ci] Bumped minor version

* remove old unused multicollect files

* [skip ci] Bumped minor version

* Enforce usage of isort

Update the configuration for isort.

Enforce usage of isort via a pre-commit hook.

* [skip ci] Bumped minor version

* New Snapshot routine

Co-authored-by: marcus-oscarsson <oscarsso@esrf.fr>

* Logging

* Taking snapshots depending on whats set on data collection

* cleanup of old snapshot routine

Co-authored-by: marcus-oscarsson <oscarsso@esrf.fr>

* fix isort and docstring style

* [skip ci] Bumped minor version

* [WF] - Fix for issue mxcube#689 : decrease length of autprocessing directory name

* [WF] - Issue mxcube#687:  Fix of typo

* [WF] - Changed hardcoded host

* [WF] - Issue mxcube#697 : Refactoring of paramaters passed by workflows used by ICAT LIMS

* [WF] - Issue mxcube#697: Added some documentation of workflow_params

* [WF] - Changes from tests on MASSIF 1 on 2024/09/27 - tests of GPhL workflows

* [skip ci] Bumped minor version

* Aded final fix for bu gin centring-mode 'none'

* [skip ci] Bumped minor version

* set correct return type

* Use type hints

* [skip ci] Bumped minor version

* [Queue] - Simplified mount_sample and related logic

* [Harvester] Added logic that were removed from mxcubeweb

 queue_harvest_sample , queue_harvest_next_sample ,  start_harvester_centring

* [skip ci] Bumped minor version

* set stream size to tuple of ints

* [skip ci] Bumped minor version

* [BlissNState] - added missing argument to _update_state

* [BLISS] - Removed depricated bliss code

* [skip ci] Bumped minor version

* [XRF] - Path to chooch changed

* [ESRF Cryo] Making sure that cryostat is initialized

* [BEAM] - beam_size handling

* [COLLECT] Open detector cover via diffractometer

* [EnergyScan] - Fix call to super classes

* Remove obsolete file - replaced by OxfordCryostream.py

* [ESRF HO] - Starting run number counting at 1

* [MCA] - MCA API change

* [skip ci] Bumped minor version

* Clarify contribution guidelines for units

* [skip ci] Bumped minor version

* Refactoring ISPyBClientMockup for authnentication tests (mxcube#1066)

Refactor ISPyBClientMockup for authentication tests

* [skip ci] Bumped minor version

* poetry lock

* [CenteredPoint] - Using position name instead of id for index

* [skip ci] Bumped minor version

* [SampleView] - Use complete name with the "A"

* [skip ci] Bumped minor version

* Added configurable log output for external programs from GPhL WF

* [skip ci] Bumped minor version

* queue models: handle omitted 'centred_pos' argument

In the utility function to_collect_dict(), take into the account
that 'centred_pos' argument can be omitted.

Don't call centred_pos.get_index() if 'centred_pos' is omitted
or is None.

* [skip ci] Bumped minor version

* Use types from typing for Type Hints

* [skip ci] Bumped minor version

* MAXIV: remove obsolete hardware objects

Remove MAXIV hardware objects that are no longer in use.

* [skip ci] Bumped minor version

* Now persists hidden state when moving motors

* added way to preserve state when recreating shapes

* [skip ci] Bumped minor version

* Remove obsolete ESRF files

* [skip ci] Bumped minor version

* Fix for the broken data collections when no beamtime ID is open. Fallback to the local dir. No online data processing.
Rebasing

* Fix log debug in P11Collect

* Characterisation sequence fix in P11Collect

* Rebasing
Removed extensive debug delays in characterisation P11Collect

* Linting

* [skip ci] Bumped minor version

* Fix deprecated code for redis client

* [skip ci] Bumped minor version

* [ESRF] EdnaWorkflow: send XML-RPC host and port to BES

* [skip ci] Bumped minor version

* Removed obsolete temporary fix for hdf5 file names

* Bug fix - changed save_scene_snapshot call to save_snapshot

* [skip ci] Bumped minor version

* Remove TangoLimaVideoLoopback

* remove imageType

* Remove VaporyVideo

* fix import in VimbaVideo.py

* Remove Camera.py

* Remove unused allocations

* Prevent using deprecated set_is_ready function

* [skip ci] Bumped minor version

* don't report expected failure as an error

* fix typo

* code used over XML-RPC should not handle that usage, the XML-RPC end-points should

* [skip ci] Bumped minor version

* fix GenericWorkflowQueueEntry execute method

* [skip ci] Bumped minor version

* missing package

* use aperture mockup class

* update server config

* beam class refactor

* [ICAT] - Initial AbstractLims and ICAT integration

* Added missing file lims_session.py

* Moved ISPyBAbstractLims to abstract submodule

* [DOC] - Fixed typos

* Fixed log messages

* Fixed typo

* [skip ci] Bumped minor version

* update BL

* adds sso config

* [LIMS] - Added mockup for create_session, still used by Qt mockup code

* added missing mock function store_robot_action

* Added missing mockup for _store_data_colection_group

* [skip ci] Bumped minor version

* adds get_centred_point_from_coord func

* update schema

* pre-commit

* bump version

* udpate CORS

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Marcus Oskarsson <oscarsso@esrf.fr>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrey Gruzinov <andrey.gruzinov@desy.de>
Co-authored-by: rhfogh <rhfogh@globalphasing.com>
Co-authored-by: Marcus Oscarsson <marcus.oscarsson@esrf.fr>
Co-authored-by: Elmir <elmir.jagudin@maxiv.lu.se>
Co-authored-by: Mikel Eguiraun <mikel.eguiraun@maxiv.lu.se>
Co-authored-by: Antonia Beteva <beteva@debian8-devel.esrf.fr>
Co-authored-by: fabcor <fabien.coronis@maxiv.lu.se>
Co-authored-by: Antonia Beteva <beteva@esrf.fr>
Co-authored-by: walesch-yan <yan.walesch@esrf.fr>
Co-authored-by: FLorial Jean Baptiste <jflorial@embl.fr>
Co-authored-by: agruzinov <78498907+agruzinov@users.noreply.github.com>
Co-authored-by: Olof Svensson <svensson@esrf.fr>
Co-authored-by: dominikatrojanowska <154609837+dominikatrojanowska@users.noreply.github.com>
Co-authored-by: pmockoocy <pawel.mocko@s2innovation.com>
Co-authored-by: woutdenolf <woutdenolf@users.sf.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants