Skip to content

IgtMix dynamic array extension bug #109

Description

@chmarti1

There is a bug in IgtMix.__setitem__() that causes incorrect behavior when increasing the dimension of a mixture array dynamically.

>>> import pyromat.igtools as igt
>>> import pyromat as pm
>>> pm.config['unit_matter'] = 'kmol'
>>> mix = igt.IgtMix('3N2 + 2O2')
>>> mix['N2'] = [[3,2],[1,0]]
>>> print(mix)
N2 : array([[3., 2.],
       [1., 0.]])
O2 : array([[3., 3.],
       [2., 2.]])

The original O2 quantity was 2 kmol, and it should have been broadcast to be 2 kmol at all mixture array elements. The behavior seems to be unique to higher dimension arrays.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA behavior that contradicts the code's documented or otherwise expected behavior.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions