Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect values for mat_name in app.read_dot #62

Closed
yardasol opened this issue Oct 15, 2021 · 1 comment
Closed

Incorrect values for mat_name in app.read_dot #62

yardasol opened this issue Oct 15, 2021 · 1 comment

Comments

@yardasol
Copy link
Contributor

The output variable mat_name in app.read_dot is having incorrect values assigned to it. The test suite is failing due to this. See this excerpt of test_read_dot:

============================================== FAILURES ===============================================
____________________________________________ test_read_dot ____________________________________________

    def test_read_dot():
        burnable_mat, paths = app.read_dot(dot_input)
>       assert burnable_mat == 'fuel'
E       AssertionError: assert 'MultiDiGraph... and 13 edges' == 'fuel'
E         - fuel
E         + MultiDiGraph named 'fuel' with 13 nodes and 13 edges

test_app.py:60: AssertionError

This may be related to the failure of the other two failing tests, both of which throw errors during execution of app.reprocessing:

FAILED test_app.py::test_reprocessing - UnboundLocalError: local variable 'divisor' referenced befor...
FAILED test_app.py::test_refill - UnboundLocalError: local variable 'divisor' referenced before assi...

Inspecting the app.reprocessing function, we can find the following loop, within which lies an if-statement that only executes if the material name (mname) is fuel.

        .
        .
        .
        for mname in prcs.keys():  # iterate over materials
            waste[mname] = {}
            forked_mat[mname] = []
            inmass[mname] = float(mat[mname].mass)
            print("Material mass before reprocessing %f g" % inmass[mname])
            if mname == 'fuel' and mat_name_dot == 'fuel':
                w = 'waste_'
                ctr = 0
                for path in paths:
                    forked_mat[mname].append(copy.deepcopy(mat[mname]))
                    print("Material mass %f" % mat[mname].mass)
                    for p in path:
                        # Calculate fraction of the flow going to the process p
                        divisor = float(prcs[mname][p].mass_flowrate /
                                        prcs[mname]['core_outlet'].mass_flowrate)
                        .
                        .
                        .               

It is possible that fixing the bug with the first failing test will resolve the other two tests failing. We may need to create a separate issue for the other two tests.

Either way, this issue can be closed when the bug in mat_name has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant