Closed matthewdahmer closed 11 years ago
This is probably difficult to do in the current framework, for technical reasons. There is a simple workaround that should work. In the xija/component/heat.py
file add the following (after the class SolarHeat
definition:
class SolarHeat5(SolarHeat):
pass
This will be your solar heat model for 5 pitch bins. Do the same for 6, 7, etc. The point is that each number of pitch bins needs a separate class, but they can all derive from the same base SolarHeat.
@matthewdahmer - try that out in your local version and see if it works.
@matthewdahmer - I have an idea for a better way to do this by using __getattr__
and __setattr__
to handle parameter access. If it doesn't break something else this could work. I hope to have a chance to play with this later this week.
@matthewdahmer - This should do the trick, can you try it out? For some guidance see the new test code.
@taldcroft I was able to test this by editing the MinusYZ model so that three of the nodes with solarheat input used different numbers of pitch values; this ran just fine. I am however having trouble running the tests you set up in test_models.py. I keep getting errors related to relative imports or missing files. If you have some time next week, please stop by and perhaps you can show me how to run these tests.
@matthewdahmer - Sorry, I should have told you the test file can't be run directly. From the repo top directory use:
py.test xija/tests/
@taldcroft Thanks, this works! All tests passed!
Can you also try doing some fitting in gui_fit.py
as a final test? Also save a model and read it back it in.
@taldcroft All set, I performed the following actions:
gui_fit.py
gui_fit.py
using default fitting methodgui_fit.py
gui_fit.py
gui_fit.py
This should cover the process of creating, running, updating and rerunning models. All actions were completed smoothly with no errors.
@matthewdahmer - this is merged now, thanks for your help testing.
Currently, all solar heat parameter sets need to have the same number of pitch bins within the same model. This results in the use of unnecessary parameters since the solar heating profile for some nodes will not require as high a fidelity as others.