@@ -1434,7 +1434,7 @@ def check_swc_sheet(filename):
1434
1434
workbook = xlrd .open_workbook (filename )
1435
1435
sheetname = 'SWC'
1436
1436
swc_sheet = workbook .sheet_by_name (sheetname )
1437
- colheads = ['tracingFile' , 'sourceData' , 'sourceDataSample' , 'sourceDataSubmission' , 'coordinates' , 'coordinatesRegistration' , 'brainRegion' , 'brainRegionAtlas' , 'brainRegionAtlasName' , 'brainRegionAxonalProjection' , 'brainRegionDendriticProjection' , 'neuronType' , 'segmentTags' , 'proofreadingLevel' , 'notes ' ]
1437
+ colheads = ['tracingFile' , 'sourceData' , 'sourceDataSample' , 'sourceDataSubmission' , 'coordinates' , 'coordinatesRegistration' , 'brainRegion' , 'brainRegionAtlas' , 'brainRegionAtlasName' , 'brainRegionAxonalProjection' , 'brainRegionDendriticProjection' , 'neuronType' , 'segmentTags' , 'proofreadingLevel' , 'Notes ' ]
1438
1438
cellcols = ['A' ,'B' ,'C' ,'D' ,'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' ]
1439
1439
coordinatesRegistration = ['Yes' , 'No' ]
1440
1440
cols = swc_sheet .row_values (3 )
@@ -1643,12 +1643,12 @@ def save_swc_sheet(swcs, sheet, saved_datasets):
1643
1643
1644
1644
swc = SWC (tracingFile = tracingFile , sourceData = sourceData , sourceDataSample = sourceDataSample , sourceDataSubmission = sourceDataSubmission , coordinates = coordinates , coordinatesRegistration = coordinatesRegistration , brainRegion = brainRegion , brainRegionAtlas = brainRegionAtlas , brainRegionAtlasName = brainRegionAtlasName , brainRegionAxonalProjection = brainRegionAxonalProjection , brainRegionDendriticProjection = brainRegionDendriticProjection , neuronType = neuronType , segmentTags = segmentTags , proofreadingLevel = proofreadingLevel , notes = notes , data_set_id = data_set_id ,sheet_id = sheet .id )
1645
1645
swc_no_uuid = swc .save ()
1646
- print (swc_no_uuid .id )
1646
+ print ('swc id: ' + swc_no_uuid .id )
1647
1647
1648
1648
1649
1649
swc_uuid = Mne .num_to_mne (swc_no_uuid .id )
1650
1650
1651
- print (swc_uuid )
1651
+ print ('swc_uuid: ' + swc_uuid )
1652
1652
1653
1653
this_swc = SWC .objects .get (id = swc_no_uuid .id )
1654
1654
# this_swc(swc_uuid=swc_uuid)
@@ -2028,7 +2028,7 @@ def save_specimen_sheet_method_4(specimen_set, sheet):
2028
2028
2029
2029
def save_specimen_sheet_method_5 (specimen_set , sheet ):
2030
2030
# 1 datasets, 1 instruments, 0 images
2031
- # single specimen
2031
+ # 1 specimen
2032
2032
try :
2033
2033
for s in specimen_set :
2034
2034
localid = s ['LocalID' ]
@@ -2392,12 +2392,12 @@ def save_all_sheets_method_4(instruments, specimen_set, images, datasets, sheet,
2392
2392
saved = False
2393
2393
2394
2394
def save_all_sheets_method_5 (instruments , specimen_set , datasets , sheet , contributors , funders , publications , swcs ):
2395
- # if swc tab filled out we don't want images
2396
- # 1 dataset row should be filled out
2397
- # many SWC : 1 dataset
2395
+ # if swc tab filled out we don't want images
2396
+ # 1 dataset row should be filled out
2397
+ # many SWC : 1 dataset
2398
2398
# 1 specimen
2399
2399
# 1 instrument
2400
- # 1 datasest
2400
+ # 1 datasest
2401
2401
2402
2402
try :
2403
2403
specimen_object_method_5 = save_specimen_sheet_method_5 (specimen_set , sheet )
@@ -2435,7 +2435,8 @@ def metadata_version_check(filename):
2435
2435
version1 = True
2436
2436
return version1
2437
2437
2438
- def check_all_sheets (filename ):
2438
+ def check_all_sheets (filename , ingest_method ):
2439
+ ingest_method = ingest_method
2439
2440
errormsg = check_contributors_sheet (filename )
2440
2441
if errormsg != '' :
2441
2442
return errormsg
@@ -2454,12 +2455,14 @@ def check_all_sheets(filename):
2454
2455
errormsg = check_specimen_sheet (filename )
2455
2456
if errormsg != '' :
2456
2457
return errormsg
2457
- errormsg = check_image_sheet (filename )
2458
- if errormsg != '' :
2459
- return errormsg
2460
- errormsg = check_swc_sheet (filename )
2461
- if errormsg != '' :
2462
- return errormsg
2458
+ if ingest_method != 'ingest_5' :
2459
+ errormsg = check_image_sheet (filename )
2460
+ if errormsg != '' :
2461
+ return errormsg
2462
+ if ingest_method == 'ingest_5' :
2463
+ errormsg = check_swc_sheet (filename )
2464
+ if errormsg != '' :
2465
+ return errormsg
2463
2466
return errormsg
2464
2467
2465
2468
@login_required
@@ -2493,7 +2496,7 @@ def descriptive_metadata_upload(request):
2493
2496
# datapath = '/home/shared_bil_dev/testetc/'
2494
2497
2495
2498
# for development locally
2496
- datapath = '/Users/luketuite /Desktop/bil_metadata_uploads'
2499
+ datapath = '/Users/ecp /Desktop/bil_metadata_uploads'
2497
2500
2498
2501
spreadsheet_file = request .FILES ['spreadsheet_file' ]
2499
2502
@@ -2514,7 +2517,7 @@ def descriptive_metadata_upload(request):
2514
2517
2515
2518
# using new metadata model
2516
2519
elif version1 == False :
2517
- errormsg = check_all_sheets (filename )
2520
+ errormsg = check_all_sheets (filename , ingest_method )
2518
2521
if errormsg != '' :
2519
2522
messages .error (request , errormsg )
2520
2523
return redirect ('ingest:descriptive_metadata_upload' )
0 commit comments