Check-in [e96f1e046d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Standardize treatment of all output statistics in ptc_out_diff.py script now that cap_frac is expressed as a percentage (rather than a decimal) fraction.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e96f1e046d950e016fa112c1e9fe398fde5aa082
User & Date: mrh 2015-05-21 11:16:42
Context
2015-05-21
11:18
Revise PTC_OUTPUT_FORMAT in ptc_io.py to mention that 9.9e+99 is the output written for unlimited cap_frac and cont_amt values. check-in: c4c10e62b5 user: mrh tags: trunk
11:16
Standardize treatment of all output statistics in ptc_out_diff.py script now that cap_frac is expressed as a percentage (rather than a decimal) fraction. check-in: e96f1e046d user: mrh tags: trunk
2015-05-20
23:54
Ensure integer division in all Python versions. check-in: 5bccb99b46 user: mrh tags: trunk
Changes

Changes to ptc_out_diff.py.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from ptc_io import PTC_OUTPUT_FORMAT, PTC_OUTPUT_NAMES
from ptc_io import output_dataframe
import sys
import os
import numpy as np


EPSILON = 1.0e-5


def main():
    """Contains high-level logic of the script.
    """
    # process command-line arguments:
    parser = argparse.ArgumentParser(
................................................................................
        emsg = 'error: id values are not the same in the two output files\n'
        sys.stderr.write(emsg)
        return 1
    id_vector = adf['id']

    # count differences between dataframes for each output variable:
    for var in PTC_OUTPUT_NAMES[1:]:
        if var == 'cap_frac':
            # reduce maximum cap_frac value to 1.0 (rather than 9.9e99):
            avector = np.minimum(adf['cap_frac'], 1.0)
            bvector = np.minimum(bdf['cap_frac'], 1.0)
        else:
            avector = adf[var].copy()
            bvector = bdf[var].copy()
        count_diffs(var, avector, bvector, id_vector)

    # return no-error exit code
    return 0
# end of main function code


def count_diffs(var, a_vector, b_vector, id_vector):







|







 







<
<
<
<
<
<
<
|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
55
56
57
58
59
60
61







62
63
64
65
66
67
68
69
from ptc_io import PTC_OUTPUT_FORMAT, PTC_OUTPUT_NAMES
from ptc_io import output_dataframe
import sys
import os
import numpy as np


EPSILON = 0.001


def main():
    """Contains high-level logic of the script.
    """
    # process command-line arguments:
    parser = argparse.ArgumentParser(
................................................................................
        emsg = 'error: id values are not the same in the two output files\n'
        sys.stderr.write(emsg)
        return 1
    id_vector = adf['id']

    # count differences between dataframes for each output variable:
    for var in PTC_OUTPUT_NAMES[1:]:







        count_diffs(var, adf[var], bdf[var], id_vector)

    # return no-error exit code
    return 0
# end of main function code


def count_diffs(var, a_vector, b_vector, id_vector):