Git Product home page Git Product logo

Comments (8)

callumforrester avatar callumforrester commented on August 10, 2024 1

@olliesilvester Somewhere, I can't find it, you outlined a nice compositional idea where you build a DCM object out of a bunch of modules, so we can cope with design differences etc.

@coretl RE: finding a better solution than relying on DAQ to tell you if the PVs are correct. I think you should be relying on CI rather than DAQ, I think any solution that relies on CI to tell DAQ and/or controls if the PVs are wrong is a huge improvement on the status quo. We were hoping #507 would provide at least some of that, but open to other ideas.

from dodal.

JamesOHeaDLS avatar JamesOHeaDLS commented on August 10, 2024

Hi @callumforrester

I have a broader question - is the expectation, with the current developments to dodal, ophyd, and blusky, etc, that PV names across Diamond will adopt common naming conventions for devices?

I'm not criticising, but just highlighting that there is currently no action plan on the controls side that I'm aware of to make this happen.

Including @coretl on this thread.

Thanks,

James

from dodal.

callumforrester avatar callumforrester commented on August 10, 2024

Hi James, currently we've been doing it ad-hoc. When we encounter a discrepancy between two beamlines, we try asking the relevant controls engineer to change the PV names. This is quite nice and agile, and it means we don't need a giant work package to rename all PVs across Diamond simultaneously, just that the level of standardisation that is needed for DAQ purposes should creep in over time. I'll defer to @coretl though as I know he has opinions.

from dodal.

coretl avatar coretl commented on August 10, 2024

I'm not a big fan of the current approach of "make som PV names, and rely on DAQ to tell us if they're right", so I'm keen to find a better solution.

One possibility discussed with @gilesknap was that we make some DLS record alias templates that live in a single support module that we can include for existing beamlines. This could point to dodal as the canonical description of what PV names are required for which type of device.

from dodal.

olliesilvester avatar olliesilvester commented on August 10, 2024

As of #652, we also have an i24 DCM. So the DCM base class now should contain common PV's between i03, i22 and i24. And I guess any PV's which only differ in syntax should be renamed to a common name

from dodal.

olliesilvester avatar olliesilvester commented on August 10, 2024

@olliesilvester Somewhere, I can't find it, you outlined a nice compositional idea where you build a DCM object out of a bunch of modules, so we can cope with design differences etc.

I think I found the email you were referring to
'we have decided to decompose our current bluesky plans into common building blocks for any MX beamline to use. A beamline can then construct its specific implementation by building up these smaller generic plans. These generic plans will be stored in the mx_bluesky repo. We will also look into using bluesky's 'prepare' command for device setup.'

So yeah, same idea works for devices

from dodal.

JamesOHeaDLS avatar JamesOHeaDLS commented on August 10, 2024

Hello, I'm not familiar with dodal and friends at all so the following suggestion is with full ignorance:

Could the code not hold variables which are populated with the particular naming implementation?

eg for a DCM:

base_pv = BL03I-MO-DCM-01
bragg_suffix = :BRAGG
first_xtal_roll = :ROLL
second_xtal_roll = None
first_crystal_pitch = :PITCH
second_crystal_pitch = None
etc

from dodal.

callumforrester avatar callumforrester commented on August 10, 2024

@JamesOHeaDLS Yes, good suggestion, I think this covers at least some of the use cases. It requires there to be a consistent superstate of all DCMs, i.e. something that could hold all of the variables without conflicts. That does make it harder to tell how the DCM works just from reading the code though. For instance, if I03's DCM has a second_crystal_pitch = Motor("BL03I-MO-ETC") and I22's has second_crystal_pitch = None, you have to look it up somewhere. And every piece of code that access it has to check if it's None or not.

It would be nicer if I22's DCM simply didn't have a second_crystal_pitch attribute in the first place. Then it's immediately obvious and the code that uses it gets simpler.

Maybe something more like this?

# i22.py
def dcm() -> DCMBase:
    return DCMBase(
        "BL22I-MO-DCM-01", 
        crystals=[
            DCMCrystalRollOnly("BL22I-MO-DCM-01:XTSAL1"),
            DCMCrystalRollAndPitch("BL22I-MO-DCM-01:XTSAL2"),
        ]
    )


# i03.py
def dcm() -> DCMBase:
    return DCMBase(
        "BL03I-MO-DCM-01", 
        crystals=[
            DCMCrystalRollAndPitch("BL03I-MO-DCM-01:XTSAL1"),
            DCMCrystalRollAndPitch("BL03I-MO-DCM-01:XTSAL2"),
        ]
    )

from dodal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.