@@ -621,91 +621,91 @@ def submit_parameters(n,
621621 'color' : 'danger' })
622622
623623
624- @dash .callback (
625- Input ('url-create-peakindexing' ,'pathname' ),
626- prevent_initial_call = True ,
627- )
628- def get_peakindexings (path ):
629- root_path = DEFAULT_VARIABLES ["root_path" ]
630- if path == '/create-peakindexing' :
631- # Create a PeakIndex object with form defaults (not for database insertion)
632- peakindex_form_data = db_schema .PeakIndex (
633- scanNumber = PEAKINDEX_DEFAULTS .get ("scanNumber" , 0 ),
624+ # @dash.callback(
625+ # Input('url-create-peakindexing','pathname'),
626+ # prevent_initial_call=True,
627+ # )
628+ # def get_peakindexings(path):
629+ # root_path = DEFAULT_VARIABLES["root_path"]
630+ # if path == '/create-peakindexing':
631+ # # Create a PeakIndex object with form defaults (not for database insertion)
632+ # peakindex_form_data = db_schema.PeakIndex(
633+ # scanNumber=PEAKINDEX_DEFAULTS.get("scanNumber", 0),
634634
635- # User text
636- author = DEFAULT_VARIABLES ["author" ],
637- notes = DEFAULT_VARIABLES ["notes" ],
635+ # # User text
636+ # author=DEFAULT_VARIABLES["author"],
637+ # notes=DEFAULT_VARIABLES["notes"],
638638
639- # Processing parameters
640- # peakProgram=PEAKINDEX_DEFAULTS["peakProgram"],
641- threshold = PEAKINDEX_DEFAULTS ["threshold" ],
642- thresholdRatio = PEAKINDEX_DEFAULTS ["thresholdRatio" ],
643- maxRfactor = PEAKINDEX_DEFAULTS ["maxRfactor" ],
644- boxsize = PEAKINDEX_DEFAULTS ["boxsize" ],
645- max_number = PEAKINDEX_DEFAULTS ["max_peaks" ],
646- min_separation = PEAKINDEX_DEFAULTS ["min_separation" ],
647- peakShape = PEAKINDEX_DEFAULTS ["peakShape" ],
648- # scanPointStart=PEAKINDEX_DEFAULTS["scanPointStart"],
649- # scanPointEnd=PEAKINDEX_DEFAULTS["scanPointEnd"],
650- # depthRangeStart=PEAKINDEX_DEFAULTS.get("depthRangeStart"),
651- # depthRangeEnd=PEAKINDEX_DEFAULTS.get("depthRangeEnd"),
652- scanPoints = PEAKINDEX_DEFAULTS ["scanPoints" ],
653- scanPointslen = srange (PEAKINDEX_DEFAULTS ["scanPoints" ]).len (),
654- depthRange = PEAKINDEX_DEFAULTS ["depthRange" ],
655- depthRangelen = srange (PEAKINDEX_DEFAULTS ["depthRange" ]).len (),
656- detectorCropX1 = PEAKINDEX_DEFAULTS ["detectorCropX1" ],
657- detectorCropX2 = PEAKINDEX_DEFAULTS ["detectorCropX2" ],
658- detectorCropY1 = PEAKINDEX_DEFAULTS ["detectorCropY1" ],
659- detectorCropY2 = PEAKINDEX_DEFAULTS ["detectorCropY2" ],
660- min_size = PEAKINDEX_DEFAULTS ["min_size" ],
661- max_peaks = PEAKINDEX_DEFAULTS ["max_peaks" ],
662- smooth = PEAKINDEX_DEFAULTS ["smooth" ],
663- maskFile = PEAKINDEX_DEFAULTS ["maskFile" ],
664- indexKeVmaxCalc = PEAKINDEX_DEFAULTS ["indexKeVmaxCalc" ],
665- indexKeVmaxTest = PEAKINDEX_DEFAULTS ["indexKeVmaxTest" ],
666- indexAngleTolerance = PEAKINDEX_DEFAULTS ["indexAngleTolerance" ],
667- indexH = PEAKINDEX_DEFAULTS ["indexH" ],
668- indexK = PEAKINDEX_DEFAULTS ["indexK" ],
669- indexL = PEAKINDEX_DEFAULTS ["indexL" ],
670- indexCone = PEAKINDEX_DEFAULTS ["indexCone" ],
671- energyUnit = PEAKINDEX_DEFAULTS ["energyUnit" ],
672- exposureUnit = PEAKINDEX_DEFAULTS ["exposureUnit" ],
673- cosmicFilter = PEAKINDEX_DEFAULTS ["cosmicFilter" ],
674- recipLatticeUnit = PEAKINDEX_DEFAULTS ["recipLatticeUnit" ],
675- latticeParametersUnit = PEAKINDEX_DEFAULTS ["latticeParametersUnit" ],
676- # peaksearchPath=PEAKINDEX_DEFAULTS["peaksearchPath"],
677- # p2qPath=PEAKINDEX_DEFAULTS["p2qPath"],
678- # indexingPath=PEAKINDEX_DEFAULTS["indexingPath"],
639+ # # Processing parameters
640+ # # peakProgram=PEAKINDEX_DEFAULTS["peakProgram"],
641+ # threshold=PEAKINDEX_DEFAULTS["threshold"],
642+ # thresholdRatio=PEAKINDEX_DEFAULTS["thresholdRatio"],
643+ # maxRfactor=PEAKINDEX_DEFAULTS["maxRfactor"],
644+ # boxsize=PEAKINDEX_DEFAULTS["boxsize"],
645+ # max_number=PEAKINDEX_DEFAULTS["max_peaks"],
646+ # min_separation=PEAKINDEX_DEFAULTS["min_separation"],
647+ # peakShape=PEAKINDEX_DEFAULTS["peakShape"],
648+ # # scanPointStart=PEAKINDEX_DEFAULTS["scanPointStart"],
649+ # # scanPointEnd=PEAKINDEX_DEFAULTS["scanPointEnd"],
650+ # # depthRangeStart=PEAKINDEX_DEFAULTS.get("depthRangeStart"),
651+ # # depthRangeEnd=PEAKINDEX_DEFAULTS.get("depthRangeEnd"),
652+ # scanPoints=PEAKINDEX_DEFAULTS["scanPoints"],
653+ # scanPointslen=srange(PEAKINDEX_DEFAULTS["scanPoints"]).len(),
654+ # depthRange=PEAKINDEX_DEFAULTS["depthRange"],
655+ # depthRangelen=srange(PEAKINDEX_DEFAULTS["depthRange"]).len(),
656+ # detectorCropX1=PEAKINDEX_DEFAULTS["detectorCropX1"],
657+ # detectorCropX2=PEAKINDEX_DEFAULTS["detectorCropX2"],
658+ # detectorCropY1=PEAKINDEX_DEFAULTS["detectorCropY1"],
659+ # detectorCropY2=PEAKINDEX_DEFAULTS["detectorCropY2"],
660+ # min_size=PEAKINDEX_DEFAULTS["min_size"],
661+ # max_peaks=PEAKINDEX_DEFAULTS["max_peaks"],
662+ # smooth=PEAKINDEX_DEFAULTS["smooth"],
663+ # maskFile=PEAKINDEX_DEFAULTS["maskFile"],
664+ # indexKeVmaxCalc=PEAKINDEX_DEFAULTS["indexKeVmaxCalc"],
665+ # indexKeVmaxTest=PEAKINDEX_DEFAULTS["indexKeVmaxTest"],
666+ # indexAngleTolerance=PEAKINDEX_DEFAULTS["indexAngleTolerance"],
667+ # indexH=PEAKINDEX_DEFAULTS["indexH"],
668+ # indexK=PEAKINDEX_DEFAULTS["indexK"],
669+ # indexL=PEAKINDEX_DEFAULTS["indexL"],
670+ # indexCone=PEAKINDEX_DEFAULTS["indexCone"],
671+ # energyUnit=PEAKINDEX_DEFAULTS["energyUnit"],
672+ # exposureUnit=PEAKINDEX_DEFAULTS["exposureUnit"],
673+ # cosmicFilter=PEAKINDEX_DEFAULTS["cosmicFilter"],
674+ # recipLatticeUnit=PEAKINDEX_DEFAULTS["recipLatticeUnit"],
675+ # latticeParametersUnit=PEAKINDEX_DEFAULTS["latticeParametersUnit"],
676+ # # peaksearchPath=PEAKINDEX_DEFAULTS["peaksearchPath"],
677+ # # p2qPath=PEAKINDEX_DEFAULTS["p2qPath"],
678+ # # indexingPath=PEAKINDEX_DEFAULTS["indexingPath"],
679679
680- # File paths
681- outputFolder = PEAKINDEX_DEFAULTS ["outputFolder" ],
682- # filefolder=CATALOG_DEFAULTS["filefolder"],
683- geoFile = PEAKINDEX_DEFAULTS ["geoFile" ],
684- crystFile = PEAKINDEX_DEFAULTS ["crystFile" ],
680+ # # File paths
681+ # outputFolder=PEAKINDEX_DEFAULTS["outputFolder"],
682+ # # filefolder=CATALOG_DEFAULTS["filefolder"],
683+ # geoFile=PEAKINDEX_DEFAULTS["geoFile"],
684+ # crystFile=PEAKINDEX_DEFAULTS["crystFile"],
685685
686- # Other fields
687- depth = PEAKINDEX_DEFAULTS ["depth" ],
688- beamline = PEAKINDEX_DEFAULTS ["beamline" ],
689- )
686+ # # Other fields
687+ # depth=PEAKINDEX_DEFAULTS["depth"],
688+ # beamline=PEAKINDEX_DEFAULTS["beamline"],
689+ # )
690690
691- # Add root_path from DEFAULT_VARIABLES
692- peakindex_form_data .root_path = root_path
693- with Session (session_utils .get_engine ()) as session :
694- # Get next peakindex_id
695- next_peakindex_id = db_utils .get_next_id (session , db_schema .PeakIndex )
696- # Store next_peakindex_id and update title
697- set_props ('next-peakindex-id' , {'value' : next_peakindex_id })
698- set_props ('peakindex-title' , {'children' : f"New peak indexing { next_peakindex_id } " })
691+ # # Add root_path from DEFAULT_VARIABLES
692+ # peakindex_form_data.root_path = root_path
693+ # with Session(session_utils.get_engine()) as session:
694+ # # Get next peakindex_id
695+ # next_peakindex_id = db_utils.get_next_id(session, db_schema.PeakIndex)
696+ # # Store next_peakindex_id and update title
697+ # set_props('next-peakindex-id', {'value': next_peakindex_id})
698+ # set_props('peakindex-title', {'children': f"New peak indexing {next_peakindex_id}"})
699699
700- # Retrieve data_path and filenamePrefix from catalog data
701- catalog_data = get_catalog_data (session , PEAKINDEX_DEFAULTS ["scanNumber" ], root_path , CATALOG_DEFAULTS )
702- peakindex_form_data .data_path = catalog_data ["data_path" ]
703- peakindex_form_data .filenamePrefix = catalog_data ["filenamePrefix" ]
700+ # # Retrieve data_path and filenamePrefix from catalog data
701+ # catalog_data = get_catalog_data(session, PEAKINDEX_DEFAULTS["scanNumber"], root_path, CATALOG_DEFAULTS)
702+ # peakindex_form_data.data_path = catalog_data["data_path"]
703+ # peakindex_form_data.filenamePrefix = catalog_data["filenamePrefix"]
704704
705- # Populate the form with the defaults
706- set_peakindex_form_props (peakindex_form_data )
707- else :
708- raise PreventUpdate
705+ # # Populate the form with the defaults
706+ # set_peakindex_form_props(peakindex_form_data)
707+ # else:
708+ # raise PreventUpdate
709709
710710@dash .callback (
711711 Input ('url-create-peakindexing' , 'href' ),
0 commit comments