Update Verify a CRC1280 import authored by Anusha Ranganathan's avatar Anusha Ranganathan
---
title: Verify a CRC1280 import
---
To run the rake task from the rails console
# Verify CRC1280 import
Start the rails console
## Start bash on the web container
* Start bash on the web container
```
docker exec -it rdms_web_1 /bin/bash
```
* Check that the rake task is listed in the list of rake tasks available
```
rake -T
```
This should list all of the available rake tasks including the` rdms:crc_1280_import` task
> ```
> .....
> rake rdms:crc_1280_import:verify_import[import_id] # Verify CRC1280 import or verify CRC1280 import of an experiment
> .....
> ```
* If you want to run the verification from the rails console (and not run the rake task), start the rails console
```
bundle exec rails c
```
## Run the verification
The verification can be run for all the experiments in the importer, or for one specific experiment in the importer. It will give the status of the import and generate a CSV report, one for each experiment.
### Run the verification for one experiment in the import
**Arguments needed**
To verify the import for a specific experiment in the importer, we need two parameters
* `import_id` - This can be obtained from the url of an import
For example: for https://rdms.cottagelabs.com/importers/49?locale=en
`import_id=49`
* `entry_id` - Entry id for the experiment
The experiments (works) are displayed in [Work Entries](https://rdms.cottagelabs.com/importers/49?locale=en#work-entries) tab in the import UI
Each entry has an **Entry Id** as shown in the image
![image](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/6105789a5a5138db3b2c1c285c198a0d/Screenshot_2024-12-04_at_04.04.29.png)
`entry_id = 20409`
**Run the verification from the rails console**
Verify the import of a specific experiment in the importer
```
docker exec -it rdms_web_1 /bin/bash
bundle exec rails c
experiment_status, report_path = VerifyCRCDatasetImport.verify_experiment_and_report(49, 20409)
```
## Run the verification
> [true, "/shared/downloads/analysis_report_49_20409_12-03_21-23-11.csv"]
The verification can be run for an entire import, or for each experiment in the import. It will generate a CSV report, one for each experiment.
```
experiment_status, report_path = VerifyCRCDatasetImport.verify_experiment_and_report(49, 20410)
```
### Run the verification for each experiment
> [false, "/shared/downloads/analysis_report_49_20410_12-03_21-23-20.csv"]
* To verify the import for each verification, we need two parameters
The method returns the verification status and the path to the full csv report.
* import_id - This can be obtained from the url of an import
**Run the verification using the rake task**
For example: for https://rdms.cottagelabs.com/importers/49?locale=en `import_id=49`
To run the rake task to verify the experiment in the importer
* Import id for the experiment (entry_id)
```
bundle exec rake rdms:crc_1280_import:verify_experiment[49,20409]
```
The experiments (works) are displayed in [Work Entries](https://rdms.cottagelabs.com/importers/49?locale=en#work-entries) tab in the import UI
You should see an output, similar to the lines below.
Each entry has an **Entry Id** as shown in the image
> ```
> .....
> Verifying import 49
> Experiment import status : false
> Detailed reports is available at: /shared/downloads/analysis_report_49_20409_12-05_15-35-06.csv
> ```
![image](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/6105789a5a5138db3b2c1c285c198a0d/Screenshot_2024-12-04_at_04.04.29.png)
The task prints the verification status and the path to the full csv report.
`entry_id = 20409`
**Expected Output**
* Verify the import for each experiment
If run from the rails console or invoking the rake task, the verification method should give you the verification status and the path to the verification report.
```
experiment_status, report_path = > .verify_experiment_and_report(49, 20409)
```
### Run the verification for all experiments in the import
> [true, "/shared/downloads/analysis_report_49_20409_12-03_21-23-11.csv"]
**Arguments needed**
```
experiment_status, report_path = VerifyCRCDatasetImport.verify_experiment_and_report(49, 20410)
```
To verify the import for all the experiments in the importer, we need the parameter
* `import_id` - This can be obtained from the url of an import
For example: for https://rdms.cottagelabs.com/importers/49?locale=en
`import_id=49`
**Run the verification from the rails console**
Verify all experiments in the importer
```
experiment_status, report_path = VerifyCRCDatasetImport.verify_import(49)
```
> => [false, ["/shared/downloads/analysis_report_49_20409_12-05_16-19-20.csv", "/shared/downloads/analysis_report_49_20410_12-05_16-19-20.csv"]]
The method returns the verification status and the path to the csv reports (one for each experiment in the importer).
**Run the verification using the rake task**
To run the rake task to verify all experiments in the import
```
bundle exec rake rdms:crc_1280_import:verify_import[49]
```
You should see an output, similar to the lines below
> ```
> .....
> Verifying import 49
> import status : false
> Detailed reports are available at:
> [
> "/shared/downloads/analysis_report_49_20409_12-05_16-16-25.csv",
> "/shared/downloads/analysis_report_49_20410_12-05_16-16-25.csv"
> ]
> ```
The task prints the verification status and the path to the csv reports (one for each experiment in the importer).
**Expected Output**
If run from the rails console or invoke the rake task, the verification method should give you the verification status and the path to the verification reports (one for each experiment in the import).
> [false, "/shared/downloads/analysis_report_49_20410_12-03_21-23-20.csv"]
### Verification report explained
* The method returns the verification status and the path to the full csv report.
* The report name has the import id, the entry id and the timestamp of when the report was created
* Example report
* [Report for entry 20409](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/4d09369313ca5f08e9d08d13570ff2db/analysis_report_49_20409_12-03_21-23-11.csv)
* [Report for entry 20410](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/e1e8a22d51c176721c4455664b6aa6f6/analysis_report_49_20410_12-03_21-23-20.csv)
* The first row of the report has all of the different ids or paths used in the comparison
* The subsequent rows are file paths, and their outcome
\ No newline at end of file
* The report name has the import id, the entry id and the timestamp of when the report was created
* Example report
* [Report for entry 20409](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/4d09369313ca5f08e9d08d13570ff2db/analysis_report_49_20409_12-03_21-23-11.csv)
* [Report for entry 20410](https://gitlab.ruhr-uni-bochum.de/-/project/864/uploads/e1e8a22d51c176721c4455664b6aa6f6/analysis_report_49_20410_12-03_21-23-20.csv)
* The first row of the report has all of the different ids or paths used in the comparison
* The subsequent rows are file paths, and their outcome
\ No newline at end of file