International-Soil-Radiocarbon-Database / ISRaD

Repository for the development and release of ISRaD data and tools
https://international-soil-radiocarbon-database.github.io/ISRaD/
24 stars 15 forks source link

compile function only compiles single dataset #9

Closed jb388 closed 6 years ago

jb388 commented 6 years ago

I tried to run the compile function on a local copy of the dataset directory (complete with the QAQC and database folders), but the function only compiled the first dataset in the directory. The QAQC and database logs were written to the appropriate folder, but only for the first dataset. Additionally, the object I defined was empty:

(scd <- compile("dataset_directory", write_report = T, write_out = T)) # returns nothing

Alison also reported that she was unable to get the function working.

greymonroe commented 6 years ago

Can you post the contents of dataset_directory/database/ISRaD_log.txt?

jb388 commented 6 years ago

Here's the log file:

ISRaD Compilation Log

2018-08-23 09:34:45


Checking compatibility between ISRaD template and info file... metadata ... site ... profile ... flux ... layer ... interstitial ... fraction ... incubation ... Checking template info file controlled vocab syntax and values... general info ... metadata ... site ... profile ... flux ... layer ... interstitial ... fraction ... incubation ...

Compiling data files in /Users/jeff/R/israd/depthneg/All/


1 checking Agnelli_2002.xlsx ...

greymonroe commented 6 years ago

thank you. what are the contents of the Agnelli_2002 QAQC report?

jb388 commented 6 years ago

See below. Interestingly, it looks like the output from the additional commands I was running in the console were copied to the QAQC report. Maybe that's a clue?

    Thank you for contributing to the ISRaD database! 
     Please review this quality control report. 
     Visit https://international-soil-radiocarbon-database.github.io/ISRaD/contribute/ for more information. 

File: Agnelli_2002.xlsx Time: 2018-08-23 15:22:24

Checking file type...

Checking file format compatibility with ISRaD templates... Template format detected: ISRaD_Master_Template.xlsx Template info file to be used for QAQC: ISRaD_Template_Info.xlsxError in read.xlsx.default(file, sheet = s) : Cannot find sheet named "NA" Error in str(scd.mpi2) : object 'scd.mpi2' not found [1] 1 2 3 4 5 6 7 8 9 10

greymonroe commented 6 years ago

K can you email me Agnelli_2002.xlsx?

On Aug 23, 2018, at 3:26 PM, Jeff B notifications@github.com wrote:

See below. Interestingly, it looks like the output from the additional commands I was running in the console were copied to the QAQC report. Maybe that's a clue?

Thank you for contributing to the ISRaD database! 
 Please review this quality control report. 
 Visit https://international-soil-radiocarbon-database.github.io/ISRaD/contribute/ for more information. 

File: Agnelli_2002.xlsx Time: 2018-08-23 15:22:24

Checking file type...

Checking file format compatibility with ISRaD templates... Template format detected: ISRaD_Master_Template.xlsx Template info file to be used for QAQC: ISRaD_Template_Info.xlsxError in read.xlsx.default(file, sheet = s) : Cannot find sheet named "NA" Error in str(scd.mpi2) : object 'scd.mpi2' not found [1] 1 2 3 4 5 6 7 8 9 10

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/International-Soil-Radiocarbon-Database/ISRaD/issues/9#issuecomment-415413353, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_PaH6W7nZ0prxM2Y4fsAa43xLot9ks5uTq2egaJpZM4WEijK.

greymonroe commented 6 years ago

The problem is caused by the tabs in this file not matching the template. The QAQC is trying to check a tab that doesn't exist which throws an error. This error stops the QAQC function, which i s currently writing all output to the QAQC report file (sink function). Normally, the QAQC function closes the connection to this report file, but since the error halts everything, this file connection never closes and R is going to continue to write out to this file. This is the source of the other problem you identified in issue #10.

I've changed the QAQC function so that if the tabs do not match it returns a message, rather than an error and closes the connection to the report file so that you should be able to continue working in R as usual.

I'd recommend a reinstall. let me know how it goes. Thanks!

jb388 commented 6 years ago

OK, great. Thanks a lot.