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

Performance. Analysis structure and relationship with Analysis Service refactored #95

Closed
wants to merge 40 commits into from

Conversation

rockfruit
Copy link
Contributor

The relationship between AnalysisService and the various types of
Analysis has been refactored. The class heirarchy now looks like this:

- AbstractBaseAnalysis(BaseObject)
    Fields and methods common to to AnalysisService and all types of analysis
- AbstractAnalysis(AbstractBaseAnalysis)
    Fields and methods common to all types of Analysis.
- AbstractRoutineAnalysis(AbstractBaseAnalysis)
    Fields and methods common to Routine Analyses (Analysis, Duplicate).
- AnalysisService(AbstractBaseAnalysis)
- ReferenceAnalysis(AbstractAnalysis)
- DuplicateAnalysis(AbstractRoutineAnalysis)
- Analysis(AbstractRoutineAnalysis)

    In the final schema for Analysis objects, the following fields are removed to be replaced by accessor methods on the class:
        - Service
        - ClientUID
        - ClientTitle
        - SampleTypeUID
        - SamplePointUID
        - CategoryUID
        - MethodUID
        - InstrumentUID
        - DateReceived
        - DateSampled
        - InstrumentValid

Some ReferenceFields and HistoryAwareReferenceFields were migrated to 
UIDReferenceField which uses simple StringFields to store the UIDs. The
usage of backReferences for the replaced references were factored out.After 
refactoring, the following references exis


BaseAnalysis
============
    Instrument                (UIDReferenceField)
    Method                    (UIDReferenceField)
    Calculation               (UIDReferenceField
    Category                  (UIDReferenceField)
    Department                (UIDReferenceField)
AnalysisService
===============
    Preservation              (UIDReferenceField)
    Container                 (UIDReferenceField)
    Instruments               (UIDReferenceField)
    Methods                   (UIDReferenceField)
Analysis
========
    Calculation               (HistoryAwareReferenceField
    Attachment                (UIDReferenceField)
    SamplePartition           (UIDReferenceField)
    OriginalReflexedAnalysis  (UIDReferenceField)
    ReflexAnalysisOf          (UIDReferenceField)
ReferenceAnalysis
=================
    Service                   (UIDReferenceField)
    Attachment                (UIDReferenceField)
    Instrument                (UIDReferenceField)
    Method                    (UIDReferenceField)
DuplicateAnalysis
=================
    Analysis                  (UIDReferenceField)
    Attachment                (UIDReferenceField)
    Instrument                (UIDReferenceField)

rockfruit added 22 commits May 8, 2017 14:24
This is a very simple uid-based reference field which stores a UID
or a list of UIDS as strings in the zodb, and reconstitutes them
to objects when retrieved.

It does not support backreferences, or link integrity (holdingreference)
but it also does not require the overhead of AT References which is
prohibitive for our use-case.
PEP8, cleanup, comments, and make the schemas and the migration
cooperate with each other
- Analysis.getService() is deprecated, and has been removed

- Some catalog columns in bika_analysis_catalog are removed

- Some small pep8 and cleaning up.
Down to AbstractAnalysis, then to AbstractRoutineAnalysis

AbstractBaseAnalysis -> AbstractAnalysis, AnalysisService
AbstractAnalysis -> AbstractRoutineAnalysis, ReferenceAnalysis
AbstractRoutineAnalysis -> Analysis, DuplicateAnalysis, RejectAnalysis

Lots of little refactoring as I went along.
Just added workflow call directly into the only template that uses it.
# Conflicts:
#	bika/lims/content/analysisrequest.py
#	bika/lims/upgrade/v3_2_0_1705.py
ServiceUID is derived from the AnalysisService reference, not the
other way around.
@rockfruit rockfruit force-pushed the HistoryAwareReferenceField branch from 5401133 to 73c0670 Compare May 19, 2017 09:49
@rockfruit rockfruit force-pushed the HistoryAwareReferenceField branch from 44afb54 to c9b2099 Compare May 19, 2017 09:56
xispa added 5 commits May 19, 2017 12:59
There is no need to add these methods because are inherited from
AbstractAnalysis already.
Inherited from AbstractAnalysis already
Methods inherited from AbstractAnalysis already
@rockfruit rockfruit closed this Jun 1, 2017
@rockfruit rockfruit deleted the HistoryAwareReferenceField branch June 1, 2017 08:15
@xispa xispa changed the title History aware reference field Performance. Analysis structure and relationship with Analysis Service refactored Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants