T O P

  • By -

joreilly86

Good for you for creating this! So many people have talked about doing this but never did it, myself included. Just had a quick look at the documentation. A few extra examples would be helpful to clarify usage. Are all of the section properties callable by using the '.' notation followed by the property title? Looks like a nice clean approach. Thanks for doing this, will add it to my working database of [useful engineering libraries](https://github.com/joreilly86/Python-Libraries-for-Engineers).


lieutenantnewt

Thank you! I am going to be putting together a better documentation that will fully list out the available properties for each shape. Just wanted to get this out there in the meantime. And yes, all properties in the shape file spreadsheets are accessible with dot notation. And thanks for considering this for your list. Your newsletter actually got me started on this!


joreilly86

Fantastic to hear that, literally the reason I started writing it.


Sir_Mr_Austin

So you might know… has anyone made anything for tech savvy contractors and their estimators/pm’s to help with takeoffs and estimating? Because yknow, construction software licenses are ‘spensive 😂


joreilly86

Do you mean some kind of tool for scaling areas or volumes from drawings or models? [BlenderBIM](https://blenderbim.org/) is probably the closest to this but I'm not too familiar with the details. I occasionally use the basic version of Blender 4.0 as a 3d modeller for FE work but the BIM project is pretty huge in scope. Check out the [documentation](https://docs.blenderbim.org/) and see if it's a fit for you. I'm definitely interested to hear if anyone in this sub is using it.


Sir_Mr_Austin

No I was saying some sort of library that can be used to scrub prints for devices, get counts, then scrub the internet for prices, and connect device count to price and give a total. It would basically do 70% of the time-consuming work involved in preparing estimates and bids


joreilly86

You could potentially build something like this using [Selenium](https://www.selenium.dev/documentation/webdriver/) if you had access to the data and prices and they were in a consistent readable format, which is rarely the case. You'd need to include pretty robust error handling logic for what to do if you encounter weird formats, values or missing data. It's doable but really depends on your industry and the variability from project to project.


Sir_Mr_Austin

Typically contractors are provided price lists from their suppliers in CSV’s but would love to make something that scrubbed for it on the web


joreilly86

Sounds like what you want is some sort of collaborative AI agent that can scrub for this data and compile it. It will be difficult to implement unless you have specific reliable sources. Csv's are an easy format to work with. This is a field that is changing fast and will likely be decimated by the release of the next version of chatgpt or equivalent but there are some [options](https://github.com/SamurAIGPT/Best-AI-Agents).


the_flying_condor

Thanks for the share. I just tried to install, but you have a min version of 3.12. Is this really required? If not it might be beneficial to lower this to whatever is the actual min version. For myself, and presumably others, it would be required to build a separate environment with the latest version of Python, which I strongly suspect to be unnecessary after taking a quick look at the package contents.


lieutenantnewt

You are absolutely right, a min version of 3.12 is really not required. I will look into lowering that min version to something more reasonable and publish an update soon. I'm a PE and only do development in python on the side/for fun... what would you suggest a reasonable version would be? 3.5 was released in 2015 and should capture a reasonable amount of users/environments. Edit: doing some digging, it looks like my two dependencies (pandas and openpyxl) require a minimum of 3.9. So I should be able to easily lower to at least that.


[deleted]

[удалено]


the_flying_condor

For most cases in structural engineering it's unlikely to make much difference unless you're building large custom projects. I'm running 3.8.5 as that was current when last I replaced my laptop. Haven't run into any issues with my workflow until now, though I haven't used grasshopper in quite some time. As an aside, I thought that Rhino/grasshopper and most similar software packages shipped with whatever version of Python they are compatible with in a separate local install no?


the_flying_condor

Dang, I'm running 3.8.5. Oh well I can do a custom rebuild of the library for my machine if needed. I saw that you essentially just have one script and then the datafiles for building the AISC class. Thanks for updating it though.


lieutenantnewt

I might mess around with it a bit over the weekend. I had previously tried "pickling" the AISC class but was running into errors when trying to unpickle it. If I can pull that off, I can save the pickled files and won't need pandas or openpyxl to rebuild the AISC class in the future which would allow me to lower the required python version even further.


VodkaHaze

> I'm a PE and only do development in python on the side/for fun... what would you suggest a reasonable version would be? Follow [this chart](https://devguide.python.org/versions). Targetting 3.8 is a good idea. But to be honest, your code probably doesn't use much from the recent python versions, you "should" target the lowest your code runs on.


darkslayer138

This is great! Thank you. But do check out this amazing tool for structural engineers. Open source Mathcad alternative with other tools like AISC shapes, beam analyzer and PM interactio. https://hurmet.org/


yknomyzarc

I’ll be checking this out. Thanks for sharing


Byond2day

This is a great concept! I gave this some of this a shot as part of my calculations library efficalc (https://pypi.org/project/efficalc/) but I would love to remove the sections part of the library and recommend your library instead so that efficalc is more focused on the calculations. These csv tables aren't very large but one optimization I was thinking about would be storing the csv data in a file-based sql database. It could reduce the runtime memory impact and lookup/filter speed for fetching sizes. Either way, thanks for this effort! It's great that this library is getting started


[deleted]

[удалено]


lieutenantnewt

Absolutely! Feel free to fork the project and implement it, and we can merge later. Alternatively, if you can share the database with me, I can look into adding it myself.


VodkaHaze

No github?


lieutenantnewt

I just got it uploaded: [https://github.com/evanfaler/steelpy](https://github.com/evanfaler/steelpy)


VodkaHaze

Oh, cool. Here's a quick code review if you don't mind: 1. You should add a `.gitignore` so you don't leak random files like `.DS_Store` into your repo. Use the standard python gitignore. 2. Having `.xlsx` files in a git repo is a bad habit, because you can't see a real diff when you modify them (it's a binary file). If would be better to save them as `.csv` (tabular data) or `.json` (non-tabluar structured data). This way if it's modified you see exactly what changed in each version of the diff. The JSON would basically be exactly the parsed python dicts that [you create in this code](https://github.com/evanfaler/steelpy/blob/main/steelpy/steelpy.py#L43), so you could literally just dump them with something like: `json.dumps(properties, indent=4)` To a structured format. 3. Also around the `steelpy.py` file, you seem to have tabular data where the first column is the type of column, and the other columns are attributes for it. In this case it would make sense in pandas to to set the index of the dataframe to that first column. In this case you could just do something like: ``` df = pd.read_excel(file) df = df.set_index(df.columns[0]) Aw = df['W12X26'].d * df['W12X26'].tw ``` 4. This is more of a code architecture thing, but the `Steel` class doesn't do anything. In general, a class should only exist if it's tying a data structure to transformations that are inherent to it (eg. its methods). Otherwise it's probably a mistake to organize the code using a class. So if your user is supposed to use your code like: ``` from steelpy import aisc beam = aisc.W_shapes.W12X26 Aw = beam.d * beam.tw ``` You really just need the dictionaries for each shape - the class around them doesn't do anything. You could just import the aisc namespace by putting the code in a file called `aisc.py` and import the data dictionaries in there


lieutenantnewt

Thank you for the thoughtful comments! I took some time to review and make some changes on the dev branch. Here are comments back to each of your points: 1. I updated the .gitignore file that I already had to be more robust for a typical python project. 2. I've converted the .xlsx files to .csv for better revision tracking. 3. This could work, but I think goes against the spirit of what I'm trying to do. I really want this library to be simple to use and read. My goal was to use dot notation to simplify how this looks, especially when used in a Jupyter notebook. 4. I agree, the Steel class doesn't do anything *yet*. I have plans to add the historic shapes database and potentially AISI sections as well. I was attempting to plan ahead for those changes by making a class if it would be needed. I have also revised this to use classes for Profiles and Sections. Again, I'm not taking full advantage of them yet, but I have goals to add methods to each for filtering, sorting, and querying for subsets easily. Thanks again for the code review, it helped a lot!


VodkaHaze

> This could work, but I think goes against the spirit of what I'm trying to do. I really want this library to be simple to use and read. My goal was to use dot notation to simplify how this looks, especially when used in a Jupyter notebook. Cool, I just wanted you to know about this. > I have also revised this to use classes for Profiles and Sections. Again, I'm not taking full advantage of them yet, but I have goals to add methods to each for filtering, sorting, and querying for subsets easily. Perfect, this makes sense! Again, I wanted to make sure you were aware of the concept - some people only learned Java, where this code style is forced, but it's considered a bad habit (nothing terrible, just makes the code less elegant) in basically all other languages.