-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3408 from architecture-building-systems/revert-34…
…06-revert-3265-mac-arm-native-support Enable Mac ARM support
- Loading branch information
Showing
33 changed files
with
25,233 additions
and
205 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: conda-lock | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install conda-lock with Micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: ci | ||
create-args: conda-lock | ||
init-shell: bash | ||
|
||
- name: Run conda-lock | ||
run: conda-lock --mamba -f environment.yml -p osx-64 -p linux-64 -p win-64 --lockfile ${{ runner.temp }}/conda-lock.yml | ||
shell: bash -el {0} |
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 |
---|---|---|
|
@@ -21,3 +21,5 @@ include cea/workflows/*.yml | |
include cea/dev/conda.bat | ||
|
||
graft cea/resources/radiation/bin | ||
|
||
graft cea/lib |
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
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
Binary file not shown.
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,33 @@ | ||
""" | ||
This only works for wntr v0.2.3 | ||
Apple Silicon lib builds from: | ||
WNTR (https://github.com/USEPA/WNTR/tree/0.2.3) | ||
set `use_swig` and `build` to True in setup.py | ||
make sure swig is installed | ||
python setup.py build_ext --inplace | ||
copy _evaluator and _network from build | ||
EPANET (https://github.com/OpenWaterAnalytics/EPANET/tree/v2.0.12) | ||
replace all `malloc.h` with `stdlib.h` | ||
gcc -dynamiclib *.c -o libepanet.dylib | ||
copy libepanet.dylib to Darwin folder | ||
""" | ||
|
||
import platform | ||
import sys | ||
import os | ||
|
||
if sys.platform == "darwin" and platform.processor() == "arm": | ||
# Add required shared objects to path before importing wntr | ||
sys.path.append(os.path.dirname(__file__)) | ||
|
||
# Make sure correct version of wntr is installed | ||
import wntr | ||
if wntr.__version__ != '0.2.3': | ||
raise ImportError(f"Require wntr version 0.2.3, found {wntr.__version__}") | ||
|
||
print("Applying fix for Apple Silicon") | ||
# Change where wntr looks for libepanet | ||
import wntr.epanet.toolkit | ||
wntr.epanet.toolkit.epanet_toolkit = "cea.lib" |
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
import cea.lib | ||
|
||
import os.path | ||
import tempfile | ||
|
||
|
@@ -245,7 +247,8 @@ def _load_pot_network(domain): | |
# join building locations (shapely.POINTS) and the corresponding identifiers in a DataFrame | ||
building_identifiers = [building.identifier for building in domain.buildings] | ||
building_locations = [building.location for building in domain.buildings] | ||
buildings_df = pd.DataFrame(list(zip(building_locations, building_identifiers)), columns=['geometry', 'Name']) | ||
buildings_df = Gdf(list(zip(building_locations, building_identifiers)), columns=['geometry', 'Name'], | ||
crs=domain.buildings[0].crs, geometry="geometry") | ||
|
||
# create a potential network grid with orthogonal connections between buildings and their closest street | ||
network_grid_shp = calc_connectivity_network(domain.locator.get_street_network(), | ||
|
@@ -450,7 +453,7 @@ def _set_plant_next_to_building(self, anchor_building): | |
plant_terminal = plant_terminal.rename({plant_terminal.index[0]: plant_terminal_node}) | ||
plant_terminal['Type'][0] = "PLANT" | ||
|
||
self.network_nodes = self.network_nodes.append(plant_terminal) | ||
self.network_nodes = pd.concat([self.network_nodes, plant_terminal]) | ||
|
||
# create new edge | ||
point1 = (plant_terminal.geometry[0].x, plant_terminal.geometry[0].y) | ||
|
@@ -461,7 +464,7 @@ def _set_plant_next_to_building(self, anchor_building): | |
'end node': plant_terminal_node}, | ||
index=['PIPE' + str(len(self.network_edges.index))], | ||
crs=Network._coordinate_reference_system) | ||
self.network_edges = self.network_edges.append(plant_to_network) | ||
self.network_edges = pd.concat([self.network_edges, plant_to_network]) | ||
|
||
def _run_water_network_model(self): | ||
""" | ||
|
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
Oops, something went wrong.