Equipment¤
Equipment
dataclass
¤
Equipment(
entered_by: str = "",
checked_by: str = "",
checked_date: date | None = None,
alias: str = "",
keywords: tuple[str, ...] = (),
id: str = "",
manufacturer: str = "",
model: str = "",
serial: str = "",
description: str = "",
specifications: Specifications = Specifications(),
location: str = "",
status: Status = Active,
loggable: bool = False,
traceable: bool = False,
calibrations: tuple[Measurand, ...] = (),
maintenance: Maintenance = Maintenance(),
alterations: tuple[Alteration, ...] = (),
firmware: tuple[Firmware, ...] = (),
specified_requirements: SpecifiedRequirements = SpecifiedRequirements(),
reference_materials: ReferenceMaterials = ReferenceMaterials(),
quality_manual: QualityManual = QualityManual(),
connection: Connection | None = None,
)
Represents the equipment element in an equipment register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entered_by
|
str
|
The name of the person who initially entered the |
''
|
checked_by
|
str
|
The name of the person who checked the information in the |
''
|
checked_date
|
date | None
|
The date that the information in the |
None
|
alias
|
str
|
An alternative name to associate with the equipment. |
''
|
keywords
|
tuple[str, ...]
|
Keywords that describe the equipment. |
()
|
id
|
str
|
Identity in an equipment register. |
''
|
manufacturer
|
str
|
Name of manufacturer. |
''
|
model
|
str
|
Manufacturer's model number (or type identification). |
''
|
serial
|
str
|
Manufacturer's serial number (or other unique identification). |
''
|
description
|
str
|
A short description about the equipment. |
''
|
specifications
|
Specifications
|
Specifications provided by the manufacturer of the equipment. |
Specifications()
|
location
|
str
|
The usual location (laboratory) that the equipment is found in. |
''
|
status
|
Status
|
The status of the equipment is an indication of whether the equipment is active (in use) or inactive (not in use). |
Active
|
loggable
|
bool
|
Whether measurements from the equipment should be logged. Equipment that monitor (for example) pressure, temperature or humidity of a laboratory environment are considered as loggable. |
False
|
traceable
|
bool
|
Whether the equipment is used for a traceable measurement. |
False
|
calibrations
|
tuple[Measurand, ...]
|
The calibration history. |
()
|
maintenance
|
Maintenance
|
The maintenance history and maintenance plan. |
Maintenance()
|
alterations
|
tuple[Alteration, ...]
|
The alteration history. |
()
|
firmware
|
tuple[Firmware, ...]
|
The firmware version history. |
()
|
specified_requirements
|
SpecifiedRequirements
|
Verification that equipment conforms with specified requirements before being placed or returned into service. |
SpecifiedRequirements()
|
reference_materials
|
ReferenceMaterials
|
Documentation of reference materials, results, acceptance criteria, relevant dates and the period of validity. |
ReferenceMaterials()
|
quality_manual
|
QualityManual
|
Information that is specified in Section 4.3.6 of the MSL Quality Manual. |
QualityManual()
|
connection
|
Connection | None
|
The connection to the equipment for computer control. |
None
|
alias
class-attribute
instance-attribute
¤
alias: str = ''
An alternative name to associate with the equipment.
alterations
class-attribute
instance-attribute
¤
alterations: tuple[Alteration, ...] = ()
The alteration history.
calibrations
class-attribute
instance-attribute
¤
The calibration history.
checked_by
class-attribute
instance-attribute
¤
checked_by: str = ''
The name of the person who checked the information in the <equipment> element.
checked_date
class-attribute
instance-attribute
¤
checked_date: date | None = None
The date that the information in the <equipment> element was last checked.
connection
class-attribute
instance-attribute
¤
connection: Connection | None = None
The connection to use for computer control.
description
class-attribute
instance-attribute
¤
description: str = ''
A short description about the equipment.
entered_by
class-attribute
instance-attribute
¤
entered_by: str = ''
The name of the person who initially entered the <equipment> element in the register.
firmware
class-attribute
instance-attribute
¤
The firmware version history.
keywords
class-attribute
instance-attribute
¤
Keywords that describe the equipment.
location
class-attribute
instance-attribute
¤
location: str = ''
The usual location (laboratory) that the equipment is found in.
loggable
class-attribute
instance-attribute
¤
loggable: bool = False
Whether measurements from the equipment should be logged.
maintenance
class-attribute
instance-attribute
¤
maintenance: Maintenance = field(default_factory=Maintenance)
The maintenance history and maintenance plan.
model
class-attribute
instance-attribute
¤
model: str = ''
Manufacturer's model number (or type identification).
quality_manual
class-attribute
instance-attribute
¤
quality_manual: QualityManual = field(default_factory=QualityManual)
Information that is specified in Section 4.3.6 of the MSL Quality Manual.
reference_materials
class-attribute
instance-attribute
¤
reference_materials: ReferenceMaterials = field(
default_factory=ReferenceMaterials
)
Documentation of reference materials, results, acceptance criteria, relevant dates and the period of validity.
serial
class-attribute
instance-attribute
¤
serial: str = ''
Manufacturer's serial number (or other unique identification).
specifications
class-attribute
instance-attribute
¤
specifications: Specifications = field(default_factory=Specifications)
Specifications provided by the manufacturer of the equipment.
specified_requirements
class-attribute
instance-attribute
¤
specified_requirements: SpecifiedRequirements = field(
default_factory=SpecifiedRequirements
)
Verification that equipment conforms with specified requirements before being placed or returned into service.
status
class-attribute
instance-attribute
¤
status: Status = Active
The status of the equipment is an indication of whether the equipment is active (in use) or inactive (not in use).
traceable
class-attribute
instance-attribute
¤
traceable: bool = False
Whether the equipment is used for a traceable measurement.
connect
¤
connect() -> Any
Connect to the equipment for computer control.
The following sequence is used to decide how the connection is established.
- If a Connection has a specified backend,
that is not
MSL, that Backend is used. - If the Equipment has the appropriate manufacturer and model values for one of the Resources, that Resource is used.
- If the Connection has an address that is supported by one of the Interfaces, that Interface is used.
Source code in src/msl/equipment/schema.py
2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 | |
from_xml
classmethod
¤
Convert an XML element into an Equipment instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
Element[str]
|
An equipment XML element from an equipment register. |
required |
Returns:
| Type | Description |
|---|---|
Equipment
|
The Equipment instance. |
Source code in src/msl/equipment/schema.py
2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 | |
latest_performance_check
¤
latest_performance_check(
*, quantity: str = "", name: str = ""
) -> LatestPerformanceCheck | None
Returns the latest performance check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantity
|
str
|
The measurand quantity. |
''
|
name
|
str
|
The component name. |
''
|
Returns:
| Type | Description |
|---|---|
LatestPerformanceCheck | None
|
The LatestPerformanceCheck for the specified
|
Source code in src/msl/equipment/schema.py
2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 | |
latest_performance_checks
¤
latest_performance_checks() -> Iterator[LatestPerformanceCheck]
Yields the latest performance check for every measurand and component.
Yields:
| Type | Description |
|---|---|
LatestPerformanceCheck
|
The latest performance check. |
Source code in src/msl/equipment/schema.py
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 | |
latest_report
¤
latest_report(
*,
quantity: str = "",
name: str = "",
date: Literal["issue", "start", "stop"] = "stop"
) -> LatestReport | None
Returns the latest calibration report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantity
|
str
|
The measurand quantity. |
''
|
name
|
str
|
The component name. |
''
|
date
|
Literal['issue', 'start', 'stop']
|
Which date in a report to use to determine what latest refers to:
|
'stop'
|
Returns:
| Type | Description |
|---|---|
LatestReport | None
|
The LatestReport for the specified |
Source code in src/msl/equipment/schema.py
2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 | |
latest_reports
¤
latest_reports(
date: Literal["issue", "start", "stop"] = "stop",
) -> Iterator[LatestReport]
Yields the latest calibration report for every measurand and component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
date
|
Literal['issue', 'start', 'stop']
|
Which date in a report to use to determine what latest refers to:
|
'stop'
|
Yields:
| Type | Description |
|---|---|
LatestReport
|
The latest calibration report. |
Source code in src/msl/equipment/schema.py
2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 | |
to_xml
¤
Convert the Equipment class into an XML element.
The connection attribute is not included as an XML element.
Returns:
| Type | Description |
|---|---|
Element[str]
|
The Equipment as an XML element. |
Source code in src/msl/equipment/schema.py
2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 | |
Latest
dataclass
¤
Latest(
calibration_interval: float = 0.0,
name: str = "",
next_calibration_date: date = date(1875, 5, 20),
quantity: str = "",
)
Base class for LatestReport and LatestPerformanceCheck.
calibration_interval
class-attribute
instance-attribute
¤
calibration_interval: float = 0.0
The number of years that may pass between a calibration or a performance check.
For equipment that do not have a required and periodic interval, but are calibrated on demand,
the value is 0.
next_calibration_date
class-attribute
instance-attribute
¤
The date that the equipment is due for a re-calibration.
If the calibration_interval is 0,
i.e., the equipment is calibrated on demand, this date is equal to the date that
the equipment was last calibrated.
is_calibration_due
¤
Determine if the equipment needs to be re-calibrated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
months
|
int
|
The number of months to add to today's date to determine if the equipment needs to be re-calibrated. |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether a calibration is due within the specified number of |
Source code in src/msl/equipment/schema.py
2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 | |
LatestPerformanceCheck
(Latest, PerformanceCheck)
dataclass
¤
LatestPerformanceCheck(
completed_date: date,
competency: Competency,
entered_by: str = "",
checked_by: str = "",
checked_date: date | None = None,
conditions: Conditions = Conditions(),
cvd_equations: tuple[CVDEquation, ...] = (),
deserialisers: tuple[Deserialised, ...] = (),
equations: tuple[Equation, ...] = (),
files: tuple[File, ...] = (),
tables: tuple[Table, ...] = (),
calibration_interval: float = 0.0,
name: str = "",
next_calibration_date: date = date(1875, 5, 20),
quantity: str = "",
)
Latest performance check.
calibration_interval
class-attribute
instance-attribute
¤
calibration_interval: float = 0.0
The number of years that may pass between a calibration or a performance check.
For equipment that do not have a required and periodic interval, but are calibrated on demand,
the value is 0.
checked_by
class-attribute
instance-attribute
¤
checked_by: str = ''
The name of the person who checked the information in the <performanceCheck> element.
checked_date
class-attribute
instance-attribute
¤
checked_date: date | None = None
The date that the information in the <performanceCheck> element was last checked.
competency
instance-attribute
¤
competency: Competency
The competent people who accomplished the performance check and the technical procedure that was executed.
completed_date
instance-attribute
¤
completed_date: date
The date that the performance check was completed.
conditions
class-attribute
instance-attribute
¤
conditions: Conditions = field(default_factory=Conditions)
The conditions under which the performance check is valid.
cvd_equation
property
¤
cvd_equation: CVDEquation
Returns the first item in the cvd_equations tuple.
Raises IndexError if the performance check does not contain Callendar-Van Dusen equations.
cvd_equations
class-attribute
instance-attribute
¤
cvd_equations: tuple[CVDEquation, ...] = ()
Performance-check data is expressed as Callendar-Van Dusen equations.
deserialised
property
¤
deserialised: Deserialised
Returns the first item in the deserialisers tuple.
Raises IndexError if the performance check does not contain serialised data.
deserialisers
class-attribute
instance-attribute
¤
deserialisers: tuple[Deserialised, ...] = ()
Performance-check data is stored in serialised formats and deserialised.
entered_by
class-attribute
instance-attribute
¤
entered_by: str = ''
The name of the person who initially entered the <performanceCheck> element in the register.
equation
property
¤
equation: Equation
Returns the first item in the equations tuple.
Raises IndexError if the performance check does not contain equations.
equations
class-attribute
instance-attribute
¤
Performance-check data is expressed as equations.
file
property
¤
file: File
Returns the first item in the files tuple.
Raises IndexError if the performance check does not contain files.
files
class-attribute
instance-attribute
¤
Performance-check data is stored in other files (not in the equipment register).
next_calibration_date
class-attribute
instance-attribute
¤
The date that the equipment is due for a re-calibration.
If the calibration_interval is 0,
i.e., the equipment is calibrated on demand, this date is equal to the date that
the equipment was last calibrated.
table
property
¤
table: Table
Returns the first item in the tables tuple.
Raises IndexError if the performance check does not contain tables.
tables
class-attribute
instance-attribute
¤
Performance-check data is stored as Comma Separated Values (CSV) tables.
from_xml
classmethod
¤
from_xml(element: Element[str]) -> PerformanceCheck
Convert an XML element into a PerformanceCheck instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
Element[str]
|
A performanceCheck XML element from an equipment register. |
required |
Returns:
| Type | Description |
|---|---|
PerformanceCheck
|
The PerformanceCheck instance. |
Source code in src/msl/equipment/schema.py
1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 | |
is_calibration_due
¤
Determine if the equipment needs to be re-calibrated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
months
|
int
|
The number of months to add to today's date to determine if the equipment needs to be re-calibrated. |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether a calibration is due within the specified number of |
Source code in src/msl/equipment/schema.py
2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 | |
to_xml
¤
Convert the PerformanceCheck class into an XML element.
Returns:
| Type | Description |
|---|---|
Element[str]
|
The PerformanceCheck as an XML element. |
Source code in src/msl/equipment/schema.py
1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 | |
LatestReport
(Latest, Report)
dataclass
¤
LatestReport(
id: str,
report_issue_date: date,
measurement_start_date: date,
measurement_stop_date: date,
issuing_laboratory: IssuingLaboratory = IssuingLaboratory(),
technical_procedure: str = "",
entered_by: str = "",
checked_by: str = "",
checked_date: date | None = None,
conditions: Conditions = Conditions(),
acceptance_criteria: AcceptanceCriteria = AcceptanceCriteria(),
cvd_equations: tuple[CVDEquation, ...] = (),
deserialisers: tuple[Deserialised, ...] = (),
equations: tuple[Equation, ...] = (),
files: tuple[File, ...] = (),
tables: tuple[Table, ...] = (),
calibration_interval: float = 0.0,
name: str = "",
next_calibration_date: date = date(1875, 5, 20),
quantity: str = "",
)
Latest calibration report.
acceptance_criteria
class-attribute
instance-attribute
¤
acceptance_criteria: AcceptanceCriteria = field(
default_factory=AcceptanceCriteria
)
Acceptance criteria for the calibration report.
calibration_interval
class-attribute
instance-attribute
¤
calibration_interval: float = 0.0
The number of years that may pass between a calibration or a performance check.
For equipment that do not have a required and periodic interval, but are calibrated on demand,
the value is 0.
checked_by
class-attribute
instance-attribute
¤
checked_by: str = ''
The name of the person who checked the information in the <report> element.
checked_date
class-attribute
instance-attribute
¤
checked_date: date | None = None
The date that the information in the <report> element was last checked.
conditions
class-attribute
instance-attribute
¤
conditions: Conditions = field(default_factory=Conditions)
The conditions under which the report is valid.
cvd_equation
property
¤
cvd_equation: CVDEquation
Returns the first item in the cvd_equations tuple.
Raises IndexError if the report does not contain Callendar-Van Dusen equations.
cvd_equations
class-attribute
instance-attribute
¤
cvd_equations: tuple[CVDEquation, ...] = ()
Calibration data is expressed as Callendar-Van Dusen equations.
deserialised
property
¤
deserialised: Deserialised
Returns the first item in the deserialisers tuple.
Raises IndexError if the report does not contain serialised data.
deserialisers
class-attribute
instance-attribute
¤
deserialisers: tuple[Deserialised, ...] = ()
Calibration data is stored in serialised formats and deserialised.
entered_by
class-attribute
instance-attribute
¤
entered_by: str = ''
The name of the person who initially entered the <report> element in the register.
equation
property
¤
equation: Equation
Returns the first item in the equations tuple.
Raises IndexError if the report does not contain equations.
equations
class-attribute
instance-attribute
¤
Calibration data is expressed as equations.
file
property
¤
file: File
Returns the first item in the files tuple.
Raises IndexError if the report does not contain files.
files
class-attribute
instance-attribute
¤
Calibration data is stored in other files (not in the equipment register).
issuing_laboratory
class-attribute
instance-attribute
¤
issuing_laboratory: IssuingLaboratory = field(default_factory=IssuingLaboratory)
Information about the laboratory that issued the calibration report.
measurement_start_date
instance-attribute
¤
measurement_start_date: date
The date that the calibration measurement started.
measurement_stop_date
instance-attribute
¤
measurement_stop_date: date
The date that the calibration measurement stopped.
next_calibration_date
class-attribute
instance-attribute
¤
The date that the equipment is due for a re-calibration.
If the calibration_interval is 0,
i.e., the equipment is calibrated on demand, this date is equal to the date that
the equipment was last calibrated.
table
property
¤
table: Table
Returns the first item in the tables tuple.
Raises IndexError if the report does not contain tables.
tables
class-attribute
instance-attribute
¤
Calibration data is stored as Comma Separated Values (CSV) tables.
technical_procedure
class-attribute
instance-attribute
¤
technical_procedure: str = ''
The technical procedure(s) that was(were) followed to perform the calibration.
from_xml
classmethod
¤
Convert an XML element into a Report instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
Element[str]
|
A report XML element from an equipment register. |
required |
Returns:
| Type | Description |
|---|---|
Report
|
The Report instance. |
Source code in src/msl/equipment/schema.py
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 | |
is_calibration_due
¤
Determine if the equipment needs to be re-calibrated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
months
|
int
|
The number of months to add to today's date to determine if the equipment needs to be re-calibrated. |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether a calibration is due within the specified number of |
Source code in src/msl/equipment/schema.py
2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 | |
to_xml
¤
Convert the Report class into an XML element.
Returns:
| Type | Description |
|---|---|
Element[str]
|
The Report as an XML element. |
Source code in src/msl/equipment/schema.py
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 | |