Conversation
brgix
commented
Aug 3, 2025
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: python -m pip install --upgrade pip setuptools wheel openstudio oslg numpy |
Member
Author
There was a problem hiding this comment.
Not even sure this numpy pip call was at all required.
brgix
commented
Aug 3, 2025
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: python -m pip install --upgrade pip setuptools wheel openstudio oslg numpty |
Member
Author
There was a problem hiding this comment.
GitHub Actions certainly didn't trip over this "numpty" typo.
brgix
commented
Aug 3, 2025
|
|
||
| if sched.to_ScheduleConstant(): | ||
| sched = sched.to_ScheduleConstant().get() | ||
| minimum = scheduleConstantMinMax(sched)[:min] |
brgix
commented
Aug 3, 2025
| min = 0.050 # minimum ratio value ( 5%) | ||
| max = 0.950 # maximum ratio value (95%) | ||
| mn = 0.050 # minimum ratio value ( 5%) | ||
| mx = 0.950 # maximum ratio value (95%) |
Member
Author
There was a problem hiding this comment.
Yish. Thought I had purged out all min and max variables.
brgix
commented
Aug 3, 2025
| maximum = float(maximum) | ||
| return maximum | ||
| except: | ||
| return 0.0 |
Member
Author
There was a problem hiding this comment.
No logged warnings or errors if invalid input. Will ultimately return 0.0 if all three parameters can't be converted to floating point numbers.
brgix
commented
Aug 3, 2025
| oslg.log(CN.WRN, "SRR (%.2f) reset to 90% (%s)" % (srr, mth)) | ||
|
|
||
| srr = numpy.clip(srr, 0.00, 0.10) | ||
| srr = clamp(srr, 0.00, 0.10) |
Member
Author
There was a problem hiding this comment.
Similar function call/arguments as Numpy's clip. Haven't added unit stress tests, yet all higher-level functions work as intended. Good enough for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OSut operates heavily off of OpenStudio's SWIG Python bindings (i.e.
import openstudio). It also relies on OSlg as an external logger. In addition, OSut relies on a handful of built-in (internal) Python packages/modules:Numpy is the only external Python package/module, used solely to
clipnumbers (within a min/max range). This PR adds an in-house function,clamp: a proxy to Numpy'sclipand/or Ruby'sclamp.There's probably not much of an overhead in importing Numpy, yet seems overkill for a single function.