CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

Very minor clean-up and improvements #136

Closed yoelcortes closed 7 months ago

yoelcortes commented 10 months ago

@CalebBell,

As I was going through the phases submodule, I found a couple of places where I could make some minor improvements:

Please let me know if there is any issue with any of these and I can undo them. These are all very minor, but I'll slowly get into the groove into contributing to this library again. For more significant contributions, I would also consult with you beforehand to make sure the direction is OK.

I have a couple of other places I would like to make moderate changes, but I'll post them as a separate issue in case you have any comments before I proceed with a pull request.

Thank you!

CalebBell commented 10 months ago

Hello Yoel! Thank you for working to improve Thermo. I do have some comments about this PR.

The rest of the cleanup looks great! Thank you.

Sincerely, Caleb

yoelcortes commented 10 months ago

Thanks for the quick and detailed reply! Great points and I am happy to undo those changes. Here are a couple of followup comments:

I do not completely follow your comment on force_phase. I hope you don't mind me asking for clarification.

Thank you!

CalebBell commented 10 months ago

Hello Yoel, Of course I don't mind you asking for more information. The force_phase setting can skip a phase ID check for a phase in a multicomponent system here: https://github.com/CalebBell/thermo/blob/master/thermo/phase_identification.py#L800

In general, I think the ability to force a thermodynamic model to be recognized in thermo as a gas, liquid, or solid - always - is something that is desirable.

There are definitely a lot of places I've gone for speed over code reduction, and so far that's been OK. Other times where I went for speed and code reduction at the same time I've ran into trouble - for example issue https://github.com/CalebBell/thermo/issues/114 where it turns out doing string replacements on source code using the inspect module and exec to avoid duplication doesn't work for some workflows.

Sincerely, Caleb

yoelcortes commented 7 months ago

@CalebBell,

I reversed the changes we talked about and changed the scalar attribute to vectorized. I didn't realized this attribute was used in so many modules until I started making the changes, but I went ahead and completed it anyway. All tests passing. Let me know if there is anything else to complete for this pull.

Thanks!

CalebBell commented 7 months ago

This looks really great Yoel! Thank you. I hope things are well.