Differences between revisions 13 and 14
Revision 13 as of 2019-04-04 10:12:11
Size: 6763
Editor: Valentina
Comment:
Revision 14 as of 2019-04-04 12:24:59
Size: 6732
Editor: Valentina
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 4: Line 3:
= READ ME CheckPerformance.py =
Line 7: Line 7:
A Python program called !CheckPerformance.py will check the XML format performance file for format correctness, and produce a compressed version of the performance file ready for upload to the IDEA site if no problems are detected.
Line 8: Line 9:
A Python program called !CheckPerformance.py will check the XML format
performance file for format correctness, and produce a compressed version of the
performance file ready for upload to the IDEA site if no problems are detected.
The program prepares a compressed tar file named ''IB-BEEF-'''ORGCODE'''-yyyymmddThhmmss.tbz2'' containing the performance file (renamed to a name similar to the compressed tar files name).
Line 12: Line 11:
The program prepares a compressed tar file named
''IB-BEEF-'''ORGCODE'''-yyyymmddThhmmss.tbz2'' containing the performance file
(renamed to a name similar to the compressed tar files name).
The program requires access to the internet and specifically to a few functions/pages in the IDEA web application. Firstly, in order to ensure that the user has the most recent version of the software, the program checks its internal version with the version stored on the Interbull server. If there is a mismatch in versions, a message is printed and the program exits and the new version of the program must be downloaded before trying again. Lists of valid orgcode’s and breed-pop-trait combinations for which the user’s organization has performance upload authority are also obtained from the IDEA web application. If errors occur, they are listed on the screen (unless redirected elsewhere) and no compressed tar file is created.
Line 16: Line 13:
The program requires access to the internet and specifically to a few
functions/pages in the IDEA web application.
Firstly, in order to ensure that the user has the most recent version of the
software, the program checks its internal version with the version stored on the
Interbull server.
If there is a mismatch in versions, a message is printed and the program exits
and the new version of the program must be downloaded before trying again.
Lists of valid orgcode’s and breed-pop-trait combinations for which the user’s
organization has performance upload authority are also obtained from the IDEA
web application.
If errors occur, they are listed on the screen (unless redirected elsewhere) and
no compressed tar file is created.

The compressed tar file produced is your checked data file to upload to the Interbull
Centre IDEA database (https://idea.interbull.org/).
The compressed tar file produced is your checked data file to upload to the Interbull Centre IDEA database (https://idea.interbull.org/).
Line 34: Line 17:
One performance file (and hence the corresponding compressed tar file) may
contain records for multiple brd-pop-trt combinations but, as that practice leads
to very large upload files, this is '''not''' a recommended practice.
One performance file (and hence the corresponding compressed tar file) may contain records for multiple brd-pop-trt combinations but, as that practice leads to very large upload files, this is '''not''' a recommended practice.
Line 38: Line 19:
It is essential that performance records for all animals are included in the
same file for any one brd-pop-trt combination whether the dataset is a first
submission for the run in question, or a re-submission with some problems
corrected.
Thus, it is not acceptable to submit a partial data-set in order to correct the
evaluations of some subset of animals.
It is essential that performance records for all animals are included in the same file for any one brd-pop-trt combination whether the dataset is a first submission for the run in question, or a re-submission with some problems corrected. Thus, it is not acceptable to submit a partial data-set in order to correct the evaluations of some subset of animals.
Line 52: Line 28:
 . d. Download the !CheckPerformance program from [[https://idea.interbull.org/software]] into the new directory  . d. Download the !CheckPerformance program from https://idea.interbull.org/software into the new directory
Line 58: Line 34:
First off, lets look at a simple example of how to execute the program that is sufficient in most cases
(you will need to replace CMBCB with our organizations code and the name of the performance file in order to successfully run this):
First off, lets look at a simple example of how to execute the program that is sufficient in most cases (you will need to replace CMBCB with our organizations code and the name of the performance file in order to successfully run this):
Line 63: Line 39:
Synopsis of how to run the program:
Line 64: Line 41:
Synopsis of how to run the program:
Line 68: Line 44:
Arguments within square brackets (i.e. `[]`) are optional to specify.<<BR>>
Arguments are meant to be specified in the order indicated.<<BR>>
The argument DATAFILE is supposed to be a filename that may be either relative (i.e. relative to the current directory) or absolute (i.e. it starts with a slash)
Arguments within square brackets (i.e. `[]`) are optional to specify.<<BR>> Arguments are meant to be specified in the order indicated.<<BR>> The argument DATAFILE is supposed to be a filename that may be either relative (i.e. relative to the current directory) or absolute (i.e. it starts with a slash)
Line 76: Line 50:
If the `-B` argument has ''not'' been provided, the generated output is put in a file in the current directory named ''IB-BEEF-'''ORGCODE'''-yyyymmddThhmmss.tbz2''<<BR>>
(or possibly with the file extension ''.tgz'' or ''.tar'' instead of ''.tbz2'' depending on what compression is available).
If the `-B` argument has ''not'' been provided, the generated output is put in a file in the current directory named ''IB-BEEF-'''ORGCODE'''-yyyymmddThhmmss.tbz2''<<BR>> (or possibly with the file extension ''.tgz'' or ''.tar'' instead of ''.tbz2'' depending on what compression is available).
Line 84: Line 57:
Line 134: Line 106:
If problems ''are'' discovered, the tail of the above messages will be replaced by one or more messages each trying to describe what the problem is.
At some points in the execution, any previously detected problem will cause immediate termination.
No output file will be created until all problems are fixed.
If problems ''are'' discovered, the tail of the above messages will be replaced by one or more messages each trying to describe what the problem is. At some points in the execution, any previously detected problem will cause immediate termination. No output file will be created until all problems are fixed.
Line 138: Line 108:
 . If you need assistance with this program, please do not hesitate to contact us at [[mailto:interbeef@slu.se|interbeef@slu.se]].  . If you need assistance with this program, please do not hesitate to contact us at interbeef@slu.se .

ibc_logo.jpg

READ ME CheckPerformance.py

General information

A Python program called CheckPerformance.py will check the XML format performance file for format correctness, and produce a compressed version of the performance file ready for upload to the IDEA site if no problems are detected.

The program prepares a compressed tar file named IB-BEEF-ORGCODE-yyyymmddThhmmss.tbz2 containing the performance file (renamed to a name similar to the compressed tar files name).

The program requires access to the internet and specifically to a few functions/pages in the IDEA web application. Firstly, in order to ensure that the user has the most recent version of the software, the program checks its internal version with the version stored on the Interbull server. If there is a mismatch in versions, a message is printed and the program exits and the new version of the program must be downloaded before trying again. Lists of valid orgcode’s and breed-pop-trait combinations for which the user’s organization has performance upload authority are also obtained from the IDEA web application. If errors occur, they are listed on the screen (unless redirected elsewhere) and no compressed tar file is created.

The compressed tar file produced is your checked data file to upload to the Interbull Centre IDEA database (https://idea.interbull.org/).

  • Please do not modify the program to circumvent any checks. Doing so would be pointless because the same checking routine is used again inside IDEA to double-check the data file uploaded in the compressed tar file.

One performance file (and hence the corresponding compressed tar file) may contain records for multiple brd-pop-trt combinations but, as that practice leads to very large upload files, this is not a recommended practice.

It is essential that performance records for all animals are included in the same file for any one brd-pop-trt combination whether the dataset is a first submission for the run in question, or a re-submission with some problems corrected. Thus, it is not acceptable to submit a partial data-set in order to correct the evaluations of some subset of animals.

For a more detailed description, see description of the XML performance format.

Before Running the Program

  • a. Ensure there is a working network connection
  • b. Install Python (either Python3, version 3.4.8 or later, or Python2, version 2.7.5 or later) if necessary

    • (If you have a choice, prefer Python3 over Python2)
  • c. Create a new working directory/folder
  • d. Download the CheckPerformance program from https://idea.interbull.org/software into the new directory

  • e. Copy the files you want to check to the working directory (This is optional. The path to the files can also be written by the prompt as /path/filename)

Executing the Program

The shown commands assume that the working directory in point c above, is used as current directory, i.e. start by calling cd <name of directory> (once) before running the commands shown below.

First off, lets look at a simple example of how to execute the program that is sufficient in most cases (you will need to replace CMBCB with our organizations code and the name of the performance file in order to successfully run this):

python3 CheckPerformance.py CMBCB MyPerformanceFile.xml

Synopsis of how to run the program:

python3 CheckPerformance.py [-l LOGPATH] [-B] ORGCODE DATAFILE

Arguments within square brackets (i.e. []) are optional to specify.
Arguments are meant to be specified in the order indicated.
The argument DATAFILE is supposed to be a filename that may be either relative (i.e. relative to the current directory) or absolute (i.e. it starts with a slash)

The -l LOGPATH argument is used to redirect the log messages to the specified file, but alternatively all output could be redirected to a file by using normal shell redirection (i.e. ending the command with >OUTFILE).

The -B argument is meant to be used in special situations in collaboration with the Interbull Centre, but as no output file is produced in this case it may also be used when testing the input file for correctness.

If the -B argument has not been provided, the generated output is put in a file in the current directory named IB-BEEF-ORGCODE-yyyymmddThhmmss.tbz2
(or possibly with the file extension .tgz or .tar instead of .tbz2 depending on what compression is available).

Running the following command will show a brief description of how to run the program if you need a reminder:

python3 CheckPerformance.py -h

Output From the Program

If no problems are discovered in the input file (and neither the -l ... argument nor the -B argument is used), the following message will be written:

Checking program: CheckPerformance.py version 2019-04-01 v1.10, provided by Interbull Centre


***************************************************************************
Detailed report from check of the trait definitions in the performance file
***************************************************************************


TRAITS DATA
***********
A total of 0 errors found


*****************************************************************
Detailed report from check of the animals in the performance file
*****************************************************************


ANIMALS DATA
************
A total of 0 errors found


*******************************************************************
Detailed report from check of the officials in the performance file
*******************************************************************


OFFICIALS DATA
**************
A total of 0 errors found


No errors found in the performance file.


Record counts by breed/country/trait combination
************************************************
LIM/CZE/aww 12679

Writing IB-BEEF-ORGCODE-20190402T070057.tbz2 ...
Done.

and an output file (named as shown in the output) has been produced.

If problems are discovered, the tail of the above messages will be replaced by one or more messages each trying to describe what the problem is. At some points in the execution, any previously detected problem will cause immediate termination. No output file will be created until all problems are fixed.

  • If you need assistance with this program, please do not hesitate to contact us at interbeef@slu.se .

public/CheckPerformance (last edited 2021-09-03 10:23:39 by Valentina)