-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #3961 - Fix build error with Python bindings due to zlib's crypt.h #3963
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e69eed1
Use modern cmake FindPython instead, adjust variable names, default t…
jmarrec 84ff800
Fix #3961: Use my own fork of conan-center-index's zlib/1.2.11 which …
jmarrec 0e3f066
Whitespace / comments change only to openstudio.py
jmarrec d143b0f
Remove openstudio.py imports that no longer exist (no module named li…
jmarrec 986039e
Add missing modules as comments for completeness / correlation with t…
jmarrec 971d32e
Update test_path.py for python3, and use 4-space indent per PEP8
jmarrec d525c0a
Modernize the import statements, and handle case where using a packag…
jmarrec 1a4b575
Update readme
jmarrec 0ef3e89
Use dynamic loading in openstudio.py and wrap in try catch.
jmarrec 39f1e59
Make test_path use it
jmarrec 3e88ae6
add a comment
jmarrec File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,73 @@ | ||
# imports all of the openstudio libraries into a friendly namespace | ||
|
||
import .openstudioairflow as airflow | ||
import .openstudioanalysis as analysis | ||
import .openstudioanalysisdriver as analysisdriver | ||
import .openstudioenergyplus as energyplus | ||
import .openstudiogbxml as gbxml | ||
import .openstudioisomodel as isomodel | ||
import .openstudiolib as lib | ||
import .openstudiomeasure as measure | ||
import .openstudiomodel as model | ||
# import openstudiomodelcore as modelcore | ||
# import openstudiomodelgenerators as modelgenerators | ||
# import openstudiomodelgeometry as modelgeometry | ||
# import openstudiomodelhvac as modelhvac | ||
# import openstudiomodelrefrigeration as modelrefrigeration | ||
# import openstudiomodelresources as modelresources | ||
# import openstudiomodelsimulation as modelsimulation | ||
import .openstudioosversion as osversion | ||
import .openstudioradiance as radiance | ||
import .openstudiosdd as sdd | ||
# import .openstudiomodeleditor as modeleditor | ||
if __package__ or "." in __name__: | ||
|
||
from .openstudioutilities import * | ||
from .openstudioutilitiesbcl import * | ||
from .openstudioutilitiescore import * | ||
from .openstudioutilitiesdata import * | ||
from .openstudioutilitieseconomics import * | ||
from .openstudioutilitiesgeometry import * | ||
from .openstudioutilitiesidd import * | ||
from .openstudioutilitiesidf import * | ||
# from .openstudioutilitiesfiletypes import * | ||
# from .openstudioutilitiesplot import * | ||
from .openstudioutilitiessql import * | ||
from .openstudioutilitiestime import * | ||
from .openstudioutilitiesunits import * | ||
from . import openstudioairflow as airflow | ||
from . import openstudioenergyplus as energyplus | ||
from . import openstudiogbxml as gbxml | ||
from . import openstudioisomodel as isomodel | ||
from . import openstudiomeasure as measure | ||
from . import openstudiomodel as model | ||
# from . import openstudiomodelcore as modelcore | ||
# from . import openstudiomodelgenerators as modelgenerators | ||
# from . import openstudiomodelgeometry as modelgeometry | ||
# from . import openstudiomodelhvac as modelhvac | ||
# from . import openstudiomodelrefrigeration as modelrefrigeration | ||
# from . import openstudiomodelresources as modelresources | ||
# from . import openstudiomodelsimulation as modelsimulation | ||
# from . import openstudiomodelairflow as modelairflow | ||
# from . import openstudiomodelavailabilitymanager as modelavailabilitymanager | ||
# from . import openstudiomodelplantequipmentoperationscheme as modelplantequipmentoperationscheme | ||
# from . import openstudiomodelstraightcomponent as modelstraightcomponent | ||
# from . import openstudiomodelzonehvac as momodelzonehvac | ||
from . import openstudioosversion as osversion | ||
from . import openstudioradiance as radiance | ||
from . import openstudiosdd as sdd | ||
from .openstudioutilities import * | ||
from .openstudioutilitiesbcl import * | ||
from .openstudioutilitiescore import * | ||
from .openstudioutilitiesdata import * | ||
from .openstudioutilitiesgeometry import * | ||
from .openstudioutilitiesidd import * | ||
from .openstudioutilitiesidf import * | ||
# from .openstudioutilitiesfiletypes import * | ||
# from .openstudioutilitiesplot import * | ||
from .openstudioutilitiessql import * | ||
from .openstudioutilitiestime import * | ||
from .openstudioutilitiesunits import * | ||
|
||
else: | ||
|
||
import openstudioairflow as airflow | ||
import openstudioenergyplus as energyplus | ||
import openstudiogbxml as gbxml | ||
import openstudioisomodel as isomodel | ||
import openstudiomeasure as measure | ||
import openstudiomodel as model | ||
# import openstudiomodelcore as modelcore | ||
# import openstudiomodelgenerators as modelgenerators | ||
# import openstudiomodelgeometry as modelgeometry | ||
# import openstudiomodelhvac as modelhvac | ||
# import openstudiomodelrefrigeration as modelrefrigeration | ||
# import openstudiomodelresources as modelresources | ||
# import openstudiomodelsimulation as modelsimulation | ||
# import openstudiomodelairflow as modelairflow | ||
# import openstudiomodelavailabilitymanager as modelavailabilitymanager | ||
# import openstudiomodelplantequipmentoperationscheme as modelplantequipmentoperationscheme | ||
# import openstudiomodelstraightcomponent as modelstraightcomponent | ||
# import openstudiomodelzonehvac as momodelzonehvac | ||
import openstudioosversion as osversion | ||
import openstudioradiance as radiance | ||
import openstudiosdd as sdd | ||
from openstudioutilities import * | ||
from openstudioutilitiesbcl import * | ||
from openstudioutilitiescore import * | ||
from openstudioutilitiesdata import * | ||
from openstudioutilitiesgeometry import * | ||
from openstudioutilitiesidd import * | ||
from openstudioutilitiesidf import * | ||
# from openstudioutilitiesfiletypes import * | ||
# from openstudioutilitiesplot import * | ||
from openstudioutilitiessql import * | ||
from openstudioutilitiestime import * | ||
from openstudioutilitiesunits import * |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# imports all of the openstudio libraries into a friendly namespace | ||
|
||
|
||
def import_module(module_name, namespace=None): | ||
""" Helper to require a given module, and place it in a namespace or import | ||
all in global namespace. | ||
|
||
""" | ||
statement = None | ||
if namespace: | ||
if __package__ or "." in __name__: | ||
statement = "from . import {} as {}".format(module_name, namespace) | ||
else: | ||
statement = "import {} as {}".format(module_name, namespace) | ||
else: | ||
if __package__ or "." in __name__: | ||
statement = "from .{} import *".format(module_name) | ||
else: | ||
statement = "from {} import *".format(module_name) | ||
try: | ||
exec(statement) | ||
except ImportError as e: | ||
# Output expected (until fixed) ImportErrors. | ||
print(e.__class__.__name__ + ": " + str(e)) | ||
except Exception as e: | ||
# Output unexpected Exceptions. | ||
print(e, False) | ||
print(e.__class__.__name__ + ": " + str(e)) | ||
|
||
|
||
imports = [ | ||
# (Module, Namespace) | ||
('openstudioairflow', 'airflow'), | ||
('openstudioenergyplus', 'energyplus'), | ||
('openstudiogbxml', 'gbxml'), | ||
('openstudioisomodel', 'isomodel'), | ||
('openstudiomeasure', 'measure'), | ||
('openstudiomodel', 'model'), | ||
# ('openstudiomodelcore', 'modelcore'), | ||
# ('openstudiomodelgenerators', 'modelgenerators'), | ||
# ('openstudiomodelgeometry', 'modelgeometry'), | ||
# ('openstudiomodelhvac', 'modelhvac'), | ||
# ('openstudiomodelrefrigeration', 'modelrefrigeration'), | ||
# ('openstudiomodelresources', 'modelresources'), | ||
# ('openstudiomodelsimulation', 'modelsimulation'), | ||
# ('openstudiomodelairflow', 'modelairflow'), | ||
# ('openstudiomodelavailabilitymanager', 'modelavailabilitymanager'), | ||
# ('openstudiomodelplantequipmentoperationscheme', 'modelplantequipmentoperationscheme'), | ||
# ('openstudiomodelstraightcomponent', 'modelstraightcomponent'), | ||
# ('openstudiomodelzonehvac', 'momodelzonehvac'), | ||
('openstudioosversion', 'osversion'), | ||
('openstudioradiance', 'radiance'), | ||
('openstudiosdd', 'sdd'), | ||
('openstudioutilities', None), | ||
('openstudioutilitiesbcl', None), | ||
('openstudioutilitiescore', None), | ||
('openstudioutilitiesdata', None), | ||
('openstudioutilitiesgeometry', None), | ||
('openstudioutilitiesidd', None), | ||
('openstudioutilitiesidf', None), | ||
# ('openstudioutilitiesfiletypes', None), | ||
# ('openstudioutilitiesplot', None), | ||
('openstudioutilitiessql', None), | ||
('openstudioutilitiestime', None), | ||
('openstudioutilitiesunits', None), | ||
] | ||
|
||
for (module_name, namespace) in imports: | ||
import_module(module_name, namespace) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import openstudio | ||
# import openstudio | ||
import openstudio_dynamic as openstudio | ||
|
||
print openstudio.toString(openstudio.runmanager.RunManager().dbPath()) | ||
print(openstudio.toString(openstudio.runmanager.RunManager().dbPath())) | ||
|
||
# workspace test | ||
workspace = openstudio.Workspace() | ||
zone = workspace.addObject(openstudio.IdfObject(openstudio.IddObjectType("Zone"))) | ||
zone = workspace.addObject( | ||
openstudio.IdfObject(openstudio.IddObjectType("Zone")) | ||
) | ||
zone = zone.get() | ||
zone.setName("New Zone") | ||
|
||
for obj in workspace.objects(): | ||
print obj | ||
print(obj) | ||
|
||
# model test | ||
model = openstudio.model.Model() | ||
space = openstudio.model.Space(model) | ||
space.setName("New Space") | ||
|
||
for s in openstudio.model.getSpaces(model): | ||
print s | ||
print(s) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this has been approved and just wanting on the merge. conan-io/conan-center-index#1526. It'd be nice to have a ref to the official vs using the NREL so we can wait on this for another couple of days and check back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be merged until I get approved in their Early access program, where access is granted by batches every two or three weeks from what I gathered after asking them directly.
It also ties into #3940, at some point I'd just make this nrel/stable instead of nrel/testing and that's it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, well if that's the case we can make the change at later date.