Examples Directory #642
Replies: 4 comments 2 replies
-
Hi Raf, Thanks for starting this discussion. I agree with you that the examples should primarily function as tutorials for new users to understand how the interact with the code. Its secondary function is being a template upon which more advanced/tailored code can be built, e.g., commonly for the yaw optimizations and for AEP evaluations. I am a big proponent of consolidating various examples together to get back to a manageable set of examples. Examples 04, 05 and 06 that you refer to are great examples of codes that are unnecessarily repeated and can be consolidated to a single code. We also don't need a separate code to demonstrate |
Beta Was this translation helpful? Give feedback.
-
Thank you for starting the discussion @rafmudaf ! I think, maybe more for arguments sake, at least on the issue of how many examples, I might take the point of view that more can be better. Maybe I'll start with a quote from Frasier: Niles: Haven't you ever heard of less is more? In seriousness though, I think a lot of learning any code comes from running and then adapting examples, so a rich set of examples seems like a positive, versus a smaller, but neater set. @Bartdoekemeijer I think you do capture this with you primary function as teaching, and secondary as a template so maybe we aren't disagreeing too much. But I can be persuaded! Just wanted to voice this side! |
Beta Was this translation helpful? Give feedback.
-
Another idea here, where we split the examples into FLORIS and FLASC_Cookiecutter_Template:
I guess this is also closely related to our discussion of the hierarchy of repositories. |
Beta Was this translation helpful? Give feedback.
-
As noted in #739 (review), the collection of examples should either require to be run from the |
Beta Was this translation helpful? Give feedback.
-
We currently maintain a set of examples demonstrating various tasks within and around FLORIS. They are stored in the repository at https://github.com/NREL/floris/tree/main/examples. We have gotten great feedback about the impact of these examples. It seems like a great way for new users to very quickly understand how to interact within the FLORIS environment, and it's an easy place for us to define and demonstrate the workflows and semantics that we expect and have used to define the API's.
Initially in the v3 redevelopment, we settled on a set of 9 examples, and the story was fairly clear: starting from the very basic tasks of initializing FLORIS, build up to an AEP calculation and yaw optimization. That list is mostly a linear progression in complexity even though there is some redundancy (i.e. 4,5,6,7 could be combined and 8,9 could be combined). The list grew to 12 by the last v3 pre-release, 17 by v3.0, 18 in v3.1, 23 in v3.2, 25 in v3.3, and 26 in the develop branch. Pull requests #641, #639, #638, #628, #627, #533 add collectively 9 more examples including two
18b
's. If these are all merged, then the number of examples would increase to 44.At this point, I see the examples directory following the same path as it did in v2 where we ended up with a loosely correlated set of examples including two directories called "other" and very little context for how to approach the set. I'm opening this discussion with the hope that we can come to a consensus on the purpose of the examples and design them in such a way to meet that purpose.
Please comment below and I'll incorporate it into either the "Purpose" or "Suggestions" section.
Purpose
What is the purpose of the set of examples? What question are they intended to answer?
I see the set of examples primarily as a learning tool, a combination of explanation and tutorial. Each example does not need to cover exactly one task, but instead each example might cover a complete topic. For example, we currently differentiate between sweeping over wind directions (04), wind speeds (05), and wind conditions (06). Separately, these examples serve as a script to copy / paste and build on top. Collectively, they serve as an explanation of the architecture of the data structures in FLORIS and how to navigate them. In fact, 04 and 05 primarily differ only by their use of the words "wind speed" and "wind direction" in a few places (see the collapsed diff below).
diff 04_sweep_wind_directions.py 05_sweep_wind_speeds.py
If composed correctly, I think it would be equally as simple to build on top of a script that contains the information in 04, 05, and 06 and simply delete what you don't want. This is a focus on these three examples, but I think they illustrate the general point well.
The examples allow the NREL team to guide users in the way we designed the API's to be used. While we regularly talk about API design and often make improvements, we don't typically document it very well. The examples are where we can implicitly document the usage and API's that we've intentionally developed.
Suggestions
Some ideas to improve the handling of examples:
Ultimately, I think a mapping of the ideas and progression of teaching would be great for the examples that we currently have and those we'd like to have.
Beta Was this translation helpful? Give feedback.
All reactions