Skip to content

Commit e6f6f5b

Browse files
Removed (commented out) callbacks that load defaults in create_wire_reconstruction and create_peakindexing.
1 parent 0e10809 commit e6f6f5b

2 files changed

Lines changed: 124 additions & 124 deletions

File tree

laue_portal/pages/create_peakindexing.py

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -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'),

laue_portal/pages/create_wire_reconstruction.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -491,60 +491,60 @@ def submit_parameters(n,
491491
})
492492

493493

494-
@dash.callback(
495-
Input('url-create-wirerecon','pathname'),
496-
prevent_initial_call=True,
497-
)
498-
def get_wirerecons(path):
499-
root_path = DEFAULT_VARIABLES["root_path"]
500-
if path == '/create-wire-reconstruction':
501-
# Create a WireRecon object with form defaults (not for database insertion)
502-
wirerecon_form_data = db_schema.WireRecon(
503-
scanNumber=WIRERECON_DEFAULTS["scanNumber"],
494+
# @dash.callback(
495+
# Input('url-create-wirerecon','pathname'),
496+
# prevent_initial_call=True,
497+
# )
498+
# def get_wirerecons(path):
499+
# root_path = DEFAULT_VARIABLES["root_path"]
500+
# if path == '/create-wire-reconstruction':
501+
# # Create a WireRecon object with form defaults (not for database insertion)
502+
# wirerecon_form_data = db_schema.WireRecon(
503+
# scanNumber=WIRERECON_DEFAULTS["scanNumber"],
504504

505-
# User text
506-
author=DEFAULT_VARIABLES["author"],
507-
notes=DEFAULT_VARIABLES["notes"],
505+
# # User text
506+
# author=DEFAULT_VARIABLES["author"],
507+
# notes=DEFAULT_VARIABLES["notes"],
508508

509-
# Recon constraints
510-
geoFile=WIRERECON_DEFAULTS["geoFile"],
511-
percent_brightest=WIRERECON_DEFAULTS["percent_brightest"],
512-
wire_edges=WIRERECON_DEFAULTS["wire_edges"],
509+
# # Recon constraints
510+
# geoFile=WIRERECON_DEFAULTS["geoFile"],
511+
# percent_brightest=WIRERECON_DEFAULTS["percent_brightest"],
512+
# wire_edges=WIRERECON_DEFAULTS["wire_edges"],
513513

514-
# Depth parameters
515-
depth_start=WIRERECON_DEFAULTS["depth_start"],
516-
depth_end=WIRERECON_DEFAULTS["depth_end"],
517-
depth_resolution=WIRERECON_DEFAULTS["depth_resolution"],
514+
# # Depth parameters
515+
# depth_start=WIRERECON_DEFAULTS["depth_start"],
516+
# depth_end=WIRERECON_DEFAULTS["depth_end"],
517+
# depth_resolution=WIRERECON_DEFAULTS["depth_resolution"],
518518

519-
# Compute parameters
520-
num_threads=DEFAULT_VARIABLES["num_threads"],
521-
memory_limit_mb=DEFAULT_VARIABLES["memory_limit_mb"],
519+
# # Compute parameters
520+
# num_threads=DEFAULT_VARIABLES["num_threads"],
521+
# memory_limit_mb=DEFAULT_VARIABLES["memory_limit_mb"],
522522

523-
# Files
524-
scanPoints=WIRERECON_DEFAULTS["scanPoints"],
525-
scanPointslen=srange(WIRERECON_DEFAULTS["scanPoints"]).len(),
523+
# # Files
524+
# scanPoints=WIRERECON_DEFAULTS["scanPoints"],
525+
# scanPointslen=srange(WIRERECON_DEFAULTS["scanPoints"]).len(),
526526

527-
# Output
528-
outputFolder=WIRERECON_DEFAULTS["outputFolder"],
529-
verbose=DEFAULT_VARIABLES["verbose"],
530-
)
531-
# Add root_path from DEFAULT_VARIABLES
532-
wirerecon_form_data.root_path = root_path
533-
with Session(session_utils.get_engine()) as session:
534-
# # Get next wirerecon_id
535-
# next_wirerecon_id = db_utils.get_next_id(session, db_schema.WireRecon)
536-
# # Store next_wirerecon_id and update title
537-
# set_props('next-wire-recon-id', {'value': next_wirerecon_id})
538-
# set_props('wirerecon-title', {'children': f"New wire recon {next_wirerecon_id}"})
527+
# # Output
528+
# outputFolder=WIRERECON_DEFAULTS["outputFolder"],
529+
# verbose=DEFAULT_VARIABLES["verbose"],
530+
# )
531+
# # Add root_path from DEFAULT_VARIABLES
532+
# wirerecon_form_data.root_path = root_path
533+
# with Session(session_utils.get_engine()) as session:
534+
# # # Get next wirerecon_id
535+
# # next_wirerecon_id = db_utils.get_next_id(session, db_schema.WireRecon)
536+
# # # Store next_wirerecon_id and update title
537+
# # set_props('next-wire-recon-id', {'value': next_wirerecon_id})
538+
# # set_props('wirerecon-title', {'children': f"New wire recon {next_wirerecon_id}"})
539539

540-
# Retrieve data_path and filenamePrefix from catalog data
541-
catalog_data = get_catalog_data(session, WIRERECON_DEFAULTS["scanNumber"], root_path, CATALOG_DEFAULTS)
542-
wirerecon_form_data.data_path = catalog_data["data_path"]
543-
wirerecon_form_data.filenamePrefix = catalog_data["filenamePrefix"]
540+
# # Retrieve data_path and filenamePrefix from catalog data
541+
# catalog_data = get_catalog_data(session, WIRERECON_DEFAULTS["scanNumber"], root_path, CATALOG_DEFAULTS)
542+
# wirerecon_form_data.data_path = catalog_data["data_path"]
543+
# wirerecon_form_data.filenamePrefix = catalog_data["filenamePrefix"]
544544

545-
set_wire_recon_form_props(wirerecon_form_data)
546-
else:
547-
raise PreventUpdate
545+
# set_wire_recon_form_props(wirerecon_form_data)
546+
# else:
547+
# raise PreventUpdate
548548

549549
@dash.callback(
550550
Input('url-create-wirerecon', 'href'),

0 commit comments

Comments
 (0)