Library Tooling

37 views
Skip to first unread message

Leon Bowie

unread,
Nov 22, 2021, 6:10:12 AM11/22/21
to SUAVE FORUM
Hi,

I was getting started with playing around with SUAVE and noticed a couple things which could be added to improve quality of life. I just wanted to share them here and see what you thought and I would be happy to add a pull request and add them if you think they would be useful.

.gitignore
- it seems like you had a gitignore at some point but you don't have one anymore and would remove the step of manually having to remove *.pyc files on a pull request.

Typing
- as SUAVE is currently python 3.6+ it is possible to add type hints which would improve QoL by helping with development within and using SUAVE. You could also combine a tool such as mypy to run on git commits to make sure no breaking changes are added

GitHub actions
- free checks that can be run on the code to perform analysis and find bugs, useful ones can be automatically running regression tests, run coverage to make sure the test covers the new code and so on.

requirements.txt
have version of the libraries like numpy/scipy that SUAVE is known to work with so when they release a breaking change SUAVE will still use the last working version (pinned in requirements.txt)

These are just a couple ideas I had and would be happy to implement. I think this project is awesome and I am having fun working with it.

ebot...@gmail.com

unread,
Nov 22, 2021, 4:27:55 PM11/22/21
to SUAVE FORUM
Hi,
Thanks for your feedback. We appreciate it and we're glad you like the code. Let me answer a few of these.

.gitignore
Yes, we definitely have one and it ignores .pycs. Our pull request template asks you to delete pycs before running automatic regression locally. What often happens is that code will successfully run locally with the automatic regression because older .pycs exist, but when cloned to new machine actually have a small typo. This is intended to make sure this doesn't happen.

Typing
This is not a bad idea. However, we're preparing for our next major release (3.0) and it will be rewritten using JAX. I'm not certain that that would be compatible. I'd have to check.

GitHub actions
We've implemented regression, via appveyor, and coverage, via coveralls (woo green badge!), through github hooks. I don't see a benefit of reimplementing through an action, to me it seems to be functionally equivalent.

requirements.txt
This one is tricky. Versioning thing hard tends to break things, see this comment here from just this week. Knowing exactly which numpy and scipy works can be difficult to track. We have our regressions setup such that it always runs the latest the versions of the packages SUAVE requires. Thus, develop is always up to date. Releases are the issue, I guess we could force the installation to have whatever version was the latest package that day? I think even if you have develop a rule, nothing is 100%.

Thoughts?

-Emilio

Leon Bowie

unread,
Nov 22, 2021, 11:54:12 PM11/22/21
to SUAVE FORUM
Thanks for getting back to me so quickly.

I can’t believe I didn’t see the existing .gitignore and the .pyc reasoning makes a lot of sense as I can see that becoming a really annoying bug.

I just had a look through the JAX Repo and docs and it looks like it does support typing. It uses bumpy and scypi under the hood so those types can be used and the JAX specific types are also usable for typing. When do you plan on starting work on 3.0? It might be useful to use typing from the start and it should help with development. 

I think using requirements.txt to just pin major version would be useful as then you would be able to use the latest version and it would just stop major changes from the dependencies from breaking anything.

Leon Bowie

unread,
Nov 23, 2021, 12:27:20 AM11/23/21
to SUAVE FORUM
Just want to add 1 thing onto this but I think it would be great if this was published to pypi or conda so the install process would be easier. Users would just be able to run `pip install` instead of having to clone the entire repo. When doing this it might be best to just publish the library without the regression tests as they significantly increase the package size.

ebot...@gmail.com

unread,
Nov 25, 2021, 12:12:53 AM11/25/21
to SUAVE FORUM
We'd welcome your help to the code by typing the variables. We'll probably start a push sometime after the new year towards 3.0. It will be done in chunks.

We've discussed releasing a package on PyPi (SUAVE is totally compatible with pip). However, some of the developers feel that the code is supposed to be hacked at to be really useful. I'm indifferent. It may happen one day (maybe after 3.0 if it smooths the JAX integration?).

I'm wonder with all of this... what's in it for you? Why would you take time to do the dirty work? Most folks who are interested in developing really want to develop features for their applications.

-Emilio

Leon Bowie

unread,
Nov 25, 2021, 4:47:29 AM11/25/21
to SUAVE FORUM
I would be happy to help with typing variables/functions/classes when you start the rewrite for v3.

In regards for whats in it for me honestly just the experience,  I currently don't work/research in a field that is related to SUAVE however I have always been interested in it. I currently don't have any applications that I want to develop as I don't have the experience with aircraft design yet, I thought it would be good to see where I could help in order to get a better understanding of how SUAVE works in order to start using it. I have a decent amount of experience building/maintaining libraries across different fields so have a bit of knowledge on library tooling and I kind of enjoy it. Once I understand how SUAVE works I will most likely start developing features but currently I would be happy to just help out while I learn and play around with it.

ebot...@gmail.com

unread,
Nov 27, 2021, 1:40:42 PM11/27/21
to SUAVE FORUM
Sounds good. I'll try to keep you in the loop. Right now the core developers are working on papers and not on SUAVE.

-Emilio

Reply all
Reply to author
Forward
0 new messages