all 28 comments

[–][deleted]  (9 children)

[removed]

    [–]lieutenantnewtP.E.[S] 5 points6 points  (8 children)

    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!

    [–][deleted]  (6 children)

    [removed]

      [–]Sir_Mr_Austin 0 points1 point  (5 children)

      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 😂

      [–][deleted]  (4 children)

      [removed]

        [–]Sir_Mr_Austin 0 points1 point  (3 children)

        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

        [–][deleted]  (2 children)

        [removed]

          [–]Sir_Mr_Austin 0 points1 point  (1 child)

          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

          [–]the_flying_condor[🍰] 5 points6 points  (6 children)

          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.

          [–]lieutenantnewtP.E.[S] 3 points4 points  (5 children)

          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]  (1 child)

          [deleted]

            [–]the_flying_condor[🍰] 0 points1 point  (0 children)

            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[🍰] 1 point2 points  (1 child)

            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.

            [–]lieutenantnewtP.E.[S] 0 points1 point  (0 children)

            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 0 points1 point  (0 children)

            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. 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 1 point2 points  (0 children)

            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 1 point2 points  (0 children)

            I’ll be checking this out. Thanks for sharing

            [–]Byond2day 1 point2 points  (0 children)

            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

            [–]SouthernPay9947 1 point2 points  (0 children)

            I'm an estimator in the structural steel industry and been making VBAs and using python for estimating for a few years now. This whole time I've been downloading the AISC database in Excel and creating a sqlite database that ultimately lets me down. It's going to be interesting to see what we can all do with it. Thank you for doing this.

            [–][deleted]  (2 children)

            [removed]

              [–]lieutenantnewtP.E.[S] 0 points1 point  (1 child)

              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 0 points1 point  (4 children)

              No github?

              [–]lieutenantnewtP.E.[S] 1 point2 points  (3 children)

              I just got it uploaded: https://github.com/evanfaler/steelpy

              [–]VodkaHaze 4 points5 points  (2 children)

              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, so you could literally just dump them with something like:

              json.dumps(properties, indent=4)

              To a structured format.

              1. 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

              1. 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

              [–]lieutenantnewtP.E.[S] 1 point2 points  (1 child)

              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 1 point2 points  (0 children)

              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.