Skip to content
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

Issue 173 coordinate system integration #173

Open
wants to merge 191 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
348b934
add version requirements for landbosse dependencies
Dec 22, 2019
3a8d7e8
add arguments to setup() method
Dec 22, 2019
4a9860e
this version of setup.py works with pip
Dec 22, 2019
3800160
Add new directory to serve as landbosse api for interfacing with tool…
Dec 22, 2019
6f47b3f
prepare setup.py for pip install
Dec 23, 2019
2db733d
delete unnecessary files
Dec 23, 2019
1a9841b
add file to interface with SAM
Dec 23, 2019
bcb123f
Add folder with detailed input csvs
Dec 23, 2019
4544773
add pytest to install_requires
Dec 23, 2019
5b3cc3a
move csvs outside version control for now
Dec 23, 2019
3cff927
include landbosse_api in set sub directories to be packaged by bdist
Dec 23, 2019
1569cc2
Add function callable by SAM to run LandBOSSE
Dec 23, 2019
58891cc
Finish setting up run.py for SAM
Dec 23, 2019
b975e6c
Final first version to be hosted on pypi
Dec 23, 2019
f4755d2
remove run_landbosse() function call
Dec 23, 2019
77648e7
Change version of landbosse for pip
Dec 23, 2019
c2f7e05
remove print function in run_landbosse()
Jan 3, 2020
20de60b
Merge branch develop
Jan 28, 2020
e9b55c6
Replace Shapely with Sympy's version of Polygon and Point in Erection…
Jan 30, 2020
59f9e75
Add error handling for SAM
Feb 3, 2020
09b8c8d
Change polygon.contains to polygon.encloses_point()
Feb 3, 2020
383b13d
Add a nested dictionary for storing Exceptions (to output in SAM)
Feb 4, 2020
1c12d58
Update exception handling for SAM
Feb 4, 2020
b9d704d
Merge pull request #104 from WISDEM/issue_103
parangat94 Feb 26, 2020
2d76679
merge branch develop
parangat94 Feb 26, 2020
26bf66f
Add custom output dictionary for landbosse API (collection and erection)
parangat94 Feb 26, 2020
2a3502a
Complete development of results dict for landbosse_api
parangat94 Feb 26, 2020
d5f8beb
Add descriptive comments to explain scope of functions run_landbosse(…
parangat94 Feb 26, 2020
67eec82
Remove redundant initialization of results dictionary
parangat94 Feb 26, 2020
cad4a3c
Update version number and package dependecies list for new pip instal…
parangat94 Mar 1, 2020
e52ed02
add equation for tower mass as a function of nameplate and hub height
parangat94 Mar 2, 2020
a0e8c7f
Add turbine scaling functions
parangat94 Mar 2, 2020
89c66c9
Add function to modify components DF based on SAM UI inputs modified …
parangat94 Mar 2, 2020
9af91dd
Complete turbine scaling script for landbosse api
parangat94 Mar 2, 2020
deff19e
add sam_inputs dictionaryas reqd. argument to run_landbosse()
parangat94 Mar 2, 2020
d8d8edc
remove print statements and update version number
parangat94 Mar 2, 2020
e6d4e42
Add descriptive comment to help user pass the correct format of weath…
parangat94 Mar 2, 2020
b8216ae
add exception handlingfor weather data read in from SAM. That is, it …
parangat94 Mar 3, 2020
5e8b115
Change turbine rating from MW to kW in turbine_scaling.py; and update…
parangat94 Mar 7, 2020
9becf64
Add bounds on turbine size, and remove creation and deletion of temp …
parangat94 Mar 24, 2020
eac2021
Fix data type parsing error
eberlea Mar 26, 2020
902178c
Updates import of weather file in API
eberlea Mar 26, 2020
01ab84f
Revert "Fix data type parsing error"
parangat94 Mar 26, 2020
5c7917b
Merge branch 'pip_installable' of https://github.com/WISDEM/LandBOSSE…
parangat94 Mar 26, 2020
4b4c55d
Add exception handling when SAM user enters less than 10 turbines
parangat94 Mar 27, 2020
c8a322c
Exceptino handling for when SAM user enters a negative input
parangat94 Mar 27, 2020
808d67e
Modify default user inputs spreadsheet, And replace 99s in project da…
parangat94 Mar 27, 2020
84b9c52
update pandas version in setup; and prepare LandBOSSE version for PyPI
parangat94 Mar 27, 2020
48961c5
Update landbosse version to 2.2.7
parangat94 Mar 27, 2020
c2b7749
Merge branch master into branch pip_installable
parangat94 Mar 27, 2020
ed14b87
prepare v. 2.2.7 for pip install
parangat94 Mar 27, 2020
c416ec8
Fix labor cost multiplier bug in landbosse api
parangat94 Mar 27, 2020
a3e8e85
Change dict key name from total_project_cost to total_bos_cost
parangat94 Mar 30, 2020
6f5e4c2
Add keyword pass to empty error handling classes
parangat94 Mar 30, 2020
160e07d
Update LandBOSSE project data file
parangat94 Mar 30, 2020
ee4a0ed
Update LandBOSSE version to v.2.2.7.2
parangat94 Mar 30, 2020
cacc6cc
Fix bug in total bos cost calculation. Management cost was not being …
parangat94 Mar 31, 2020
96c5547
Change landbosse api version to v.2.2.7.3
parangat94 Mar 31, 2020
026bcac
ship a default weather file with pip installable landbosse
parangat94 Apr 3, 2020
2f0ea63
Add detailed run_landbosse() documentation, and fix bug in site_prep …
parangat94 Apr 3, 2020
6c4d56d
Implement loop to collect user provided inputs that will override def…
parangat94 Apr 3, 2020
c67b16e
Add file for running API tests
parangat94 Apr 3, 2020
f895500
fix file path of API_text.py
parangat94 Apr 3, 2020
5fd705b
Add 8 tests to run_landbosse(). These test the individual total cost …
parangat94 Apr 3, 2020
7f006c7
Add a test for read_weather_data()
parangat94 Apr 3, 2020
c824e09
add a test for read_data()
parangat94 Apr 3, 2020
c6c9683
Fix typo in api documentation
parangat94 Apr 3, 2020
20893f0
Finish writing tests for all outputs from landbosse api
parangat94 Apr 3, 2020
c83e287
fix typo in run_landbosse() documentation
parangat94 Apr 4, 2020
28e17c4
Add package level documentation for LandBOSSE API
parangat94 Apr 4, 2020
5ed56bd
provide example of initializing a python input dictionary
parangat94 Apr 4, 2020
5938e34
update LandBOSSE version to version 2.2.7.4
parangat94 Apr 4, 2020
94c1971
Fix documentation and update LandBOSSE version for PyPI
parangat94 Apr 4, 2020
0ae8c29
Update documentation and landbosse version number for pip installation
parangat94 Apr 4, 2020
89b9488
add file .travis.yml to initiate continuous integration in LandBOSSE
parangat94 Apr 4, 2020
0e1707f
specify pip_installable branch only in travis.yml
parangat94 Apr 4, 2020
7895e48
add link to travis ci build status
parangat94 Apr 4, 2020
2895cc3
Fix Travis CI badge
parangat94 Apr 4, 2020
bc0b58e
Fix typo in travis ci badge widget code
parangat94 Apr 4, 2020
e94e862
Specify test file to be run by travis ci
parangat94 Apr 4, 2020
744572b
Merge branch 'pip_installable' of https://github.com/WISDEM/LandBOSSE…
parangat94 Apr 4, 2020
0947603
Fix path issue in travis.yml
parangat94 Apr 4, 2020
c4e8759
try fix for specifying path in travis.yml
parangat94 Apr 4, 2020
e9ec83b
Try to fix path error
parangat94 Apr 4, 2020
4449bc3
attempt 3 to fix path error in travis ci
parangat94 Apr 4, 2020
486e9c1
Add a bug in run.py to test travis CI
parangat94 Apr 4, 2020
2eeae09
fix line 14 in travis.yml --> change 'python API_test.py' to 'pytest …
parangat94 Apr 4, 2020
40f88ba
Change Travis CI Badge Type
parangat94 Apr 4, 2020
fa38078
Fix typo in Travis CI badge
parangat94 Apr 4, 2020
49f7f2e
provide link to Travis CI page in Build Status badge
parangat94 Apr 4, 2020
e16004c
Force add a bug in run.py to test whether travis ci breaks or not
parangat94 Apr 4, 2020
d0ff39a
Remove bug that was intentionally added to break Travis CI build
parangat94 Apr 4, 2020
2fd46ff
protect all sheets of project_data_defaults.xlsx to prevent changes t…
parangat94 Apr 4, 2020
6f5b5a6
Move API testing to its own designated sub directory within landbosse_a'
parangat94 Apr 4, 2020
a607c9a
move API test to its own sub-directory, and update travis.yml accordi…
parangat94 Apr 4, 2020
6a0d3d3
Update Travis CI badge url
parangat94 Apr 4, 2020
4c68313
Reverting Travis CI build status badge url
parangat94 Apr 4, 2020
8041519
Change build status badge to image
parangat94 Apr 4, 2020
488cc2f
change build status badge to RST
parangat94 Apr 4, 2020
5aa8f0c
Finalize build status badge style to markdown
parangat94 Apr 4, 2020
6249783
add forward slash in path in travis.yml
parangat94 Apr 4, 2020
5efeb95
Refactor run.py coding style according to PEP8 style guidelines
parangat94 Apr 5, 2020
3611e13
Refactor turbine_scaling.py code to match PEP8 style guidelines
parangat94 Apr 5, 2020
190e049
Re-position example of how to run landbosse_api, to bottom of file
parangat94 Apr 5, 2020
89d6daf
Add pypi badge
parangat94 Apr 28, 2020
40e2663
Remove pypi badge
parangat94 Apr 28, 2020
6992eee
added user weather dataframe input option
Apr 28, 2020
e381867
Replace template input files with pure public data files
parangat94 May 1, 2020
6ecdf74
Merge branch develop
parangat94 May 1, 2020
6760095
Merge develop branch
parangat94 May 1, 2020
8516e1d
Comment out example of how to run landbosse_api section
parangat94 May 5, 2020
7684512
Merge pull request #140 from WISDEM/issue_137
parangat94 May 5, 2020
2690b4e
Merge branch 'develop' into pip_installable
parangat94 May 21, 2020
2cc80a1
Fix mob cost sent to API output
parangat94 May 21, 2020
2b00e73
Update API_test expected results, after merging develop
parangat94 May 22, 2020
af08b4b
Update travis.yml
parangat94 May 22, 2020
1587bf3
Comment out develop branch lines from travis
parangat94 May 22, 2020
d51cb57
Comment out run_landbosse() in run.py
parangat94 May 22, 2020
3634b0d
add pip install commands in travis.yml from landbosse dependancies
parangat94 May 23, 2020
7a8bb22
change import
parangat94 May 23, 2020
9ba66d8
all api tests pass
parangat94 May 23, 2020
c5787ce
Add import landbosse
parangat94 May 23, 2020
925750b
comment out cd statement in Travis
parangat94 May 23, 2020
c48356c
Add __init__.py to API_test
parangat94 May 24, 2020
61373bb
Add develop branch to tracked branches in travis.yml
parangat94 May 24, 2020
8b902a4
Fix broken syntax in travis.yml
parangat94 May 24, 2020
c04e450
Comment out pip install psycopg2-binaryyam in travis.yml
parangat94 May 24, 2020
a61798c
add pip install psycopg2==2.7.5 to travis.yml
parangat94 May 24, 2020
68746af
Add switch to override component scaling, and add GE 15 dist to API d…
parangat94 May 24, 2020
692e545
Comment out run_landbosse function call in run.py
parangat94 May 24, 2020
586afd5
Extend min number of turbines condition to > 0
parangat94 May 24, 2020
b623b6a
Merge branch 'pip_installable' of https://github.com/WISDEM/LandBOSSE…
parangat94 May 24, 2020
883b39f
Add argument to read_data()
parangat94 May 24, 2020
38e016c
Merge branch 'pip_installable' of https://github.com/WISDEM/LandBOSSE…
parangat94 May 24, 2020
b638b2d
Switch to relative imports in API
parangat94 May 24, 2020
3627d60
Add recent landbosse changes
parangat94 May 24, 2020
8b1ec80
Add 00k/000k substation adders for DW
parangat94 May 25, 2020
d92a86c
Ensure plant size is getting updated based on user provided num turbi…
parangat94 May 25, 2020
b57c731
Change relative imports to absolute
parangat94 May 26, 2020
f1ebe6f
Add display_results() method to main
parangat94 May 29, 2020
efd1bc2
Changes from HybridBOSSE dev
parangat94 Jun 18, 2020
d8ffff2
Update import paths in LandBOSSEs API
parangat94 Aug 20, 2020
4804a42
Switch to relative imports in LandBOSSEs API
parangat94 Aug 20, 2020
bea2360
Change v. #
parangat94 Sep 10, 2020
7349783
Change python required version to 3.6 and up
parangat94 Sep 11, 2020
64302a8
Update api version to 2.3.0.1
parangat94 Sep 11, 2020
dee5510
switch to relative import
parangat94 Sep 11, 2020
478be52
Update project data file name in manifest
parangat94 Sep 11, 2020
46317d8
Update version #
parangat94 Sep 11, 2020
a771e32
Merge pull request #169 from WISDEM/release-2.3.4
akey7 Dec 28, 2020
3e22372
Merge pull request #171 from WISDEM/release-2.3.5
akey7 Feb 9, 2021
31ee207
merge branch master into branch pip_installable
Feb 26, 2021
87b9d01
Updated Collectioncost.py and XlsxReader.py to accomodate an adjacenc…
ChristopherCampos Mar 1, 2021
69f77dc
Manual mode and Auto mode are functional and show functional differen…
ChristopherCampos Mar 2, 2021
08aa941
Update run.py
ChristopherCampos Mar 2, 2021
25e25ca
Update run.py
ChristopherCampos Mar 2, 2021
6ebae2d
Update XlsxReader.py
ChristopherCampos Mar 2, 2021
c39b28e
Update run.py
ChristopherCampos Mar 2, 2021
d2707be
Update CollectionCost.py
ChristopherCampos Mar 2, 2021
a4b72d0
Make DW substation costs 0
Mar 3, 2021
114aab6
Update pytest inputs to get unit tests to pass
Mar 3, 2021
a0c74ef
Update packages in setup.py
Mar 3, 2021
01edafd
Change version requirement of scipy in setup.py
Mar 3, 2021
ca64804
Comment out travis CI build badge
parangat94 Mar 3, 2021
2564bba
Added auto mode as default mode and corrected power costs.
ChristopherCampos Mar 3, 2021
26f7889
Fixed voltage units
ChristopherCampos Mar 4, 2021
78f049d
Fixed units and created an auto default mode.
ChristopherCampos Mar 4, 2021
9a56be8
Fixed units and replaced capacity with power
ChristopherCampos Mar 4, 2021
d041545
Update CollectionCost.py
ChristopherCampos Mar 4, 2021
58d6b72
Update XlsxReader.py
ChristopherCampos Mar 5, 2021
1e411a0
automatically runs in auto mode without specification
ChristopherCampos Mar 5, 2021
ad55e41
Update XlsxReader.py
ChristopherCampos Mar 5, 2021
b63c2d0
Update XlsxReader.py
ChristopherCampos Mar 5, 2021
fd3de20
Update CollectionCost.py
ChristopherCampos Mar 5, 2021
4590cbe
Branched from Remote
ChristopherCampos Mar 5, 2021
c22ecbd
Branched from remote
ChristopherCampos Mar 5, 2021
9d7d67a
Added auto mode as default
ChristopherCampos Mar 5, 2021
f2c21f1
Merged pip_installable
ChristopherCampos Mar 5, 2021
4e7337d
Fixed validation issue on manual mode
ChristopherCampos Mar 6, 2021
f820d09
Working build with Manual Mode of LandBOSSE with Auto Mode as default
ChristopherCampos Mar 6, 2021
c179375
Update CollectionCost.py
ChristopherCampos Mar 6, 2021
b1a08eb
Update CollectionCost.py
ChristopherCampos Mar 6, 2021
ef055e3
Fixed issue with new parameter
ChristopherCampos Mar 6, 2021
67bda87
f
ChristopherCampos Mar 6, 2021
16ee19e
Fixed parameter issues.
ChristopherCampos Mar 6, 2021
3be7677
F
ChristopherCampos Mar 6, 2021
c6c409f
Update XlsxReader.py
ChristopherCampos Mar 11, 2021
448eb25
Update XlsxReader.py
ChristopherCampos Mar 11, 2021
2334b35
Update XlsxReader.py
ChristopherCampos Mar 11, 2021
5d9ea0e
Update XlsxReader.py
ChristopherCampos Mar 11, 2021
2a23395
Update XlsxReader.py
ChristopherCampos Mar 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@ install:
- pip install scipy
- pip install xlsxwriter
- pip install xlrd
- pip install psycopg2-binary
# - pip install psycopg2-binaryyam
- pip install psycopg2==2.7.5
- pip install sqlalchemy
- pip install pytest


env:
global:
- LANDBOSSE_INPUT_DIR: $TRAVIS_BUILD_DIR/project_input_template
- LANDBOSSE_OUTPUT_DIR: $TRAVIS_BUILD_DIR/project_input_template

# command to run tests
script:
- pytest $TRAVIS_BUILD_DIR/landbosse/landbosse_api/API_test/API_test.py
- python $TRAVIS_BUILD_DIR/main.py --validate

branches:
only:
- pip_installable
- develop
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include README.md
include CHANGELOG.md
include LICENSE.txt
include landbosse/landbosse_api/project_list.xlsx
include landbosse/landbosse_api/project_data/ge15_public.xlsx
include landbosse/landbosse_api/project_data/az_rolling.srw
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.com/WISDEM/LandBOSSE.svg?branch=issue_136_add_tests)](https://travis-ci.com/WISDEM/LandBOSSE)

<!--- [![Build Status](https://travis-ci.com/WISDEM/LandBOSSE.svg?branch=pip_installable)](https://travis-ci.com/WISDEM/LandBOSSE) -->

# LandBOSSE

## Welcome to LandBOSSE!
Expand Down
Empty file added __init__.py
Empty file.
261 changes: 261 additions & 0 deletions landbosse/__init__.py

Large diffs are not rendered by default.

64 changes: 49 additions & 15 deletions landbosse/excelio/XlsxReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,32 +361,63 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
# Incomplete project dict will hold the input dictionary
# configurations.
incomplete_input_dict = dict()
incomplete_input_dict['error'] = dict()

# Read all project_data sheets.
# The erection module takes in a bunch of keys and values under the
# 'project_data' key in the incomplete_input_dict

# Apply the labor multipliers
labor_cost_multiplier = project_parameters['Labor cost multiplier']
incomplete_input_dict['labor_cost_multiplier'] = project_parameters['Labor cost multiplier']
labor_cost_multiplier = incomplete_input_dict['labor_cost_multiplier']
self.apply_labor_multiplier_to_project_data_dict(project_data_dataframes, labor_cost_multiplier)
# Apply the Collection mode
if 'Collection mode' not in project_parameters:
incomplete_input_dict['collection_mode'] = 'auto'
project_parameters['Collection mode'] = 'auto'
else:
incomplete_input_dict['collection_mode'] = project_parameters['Collection mode']


incomplete_input_dict['row_spacing_rotor_diameters'] = project_parameters['Row spacing (times rotor diameter)']
incomplete_input_dict['turbine_spacing_rotor_diameters'] = project_parameters['Turbine spacing (times rotor diameter)']

if project_parameters['Collection mode'] == 'manual':
incomplete_input_dict['collection_layout'] = project_data_dataframes['collection_layout']
erection_input_worksheets = [
'crane_specs',
'equip',
'crew',
'equip_price',
'crew_price',
'material_price',
'components',
'collection_layout'
]
else:
erection_input_worksheets = [
'crane_specs',
'equip',
'crew',
'equip_price',
'crew_price',
'material_price',
'components'
]
if project_parameters['Collection mode'] == 'manual' and (
len(project_data_dataframes['collection_layout']['Adjacency matrix']) != (
project_parameters['Number of turbines'] + 1)):
exit('ERROR: mismatch between # turbines and # turbine locations')

erection_input_worksheets = [
'crane_specs',
'equip',
'crew',
'equip_price',
'crew_price',
'material_price',
'components'
]

erection_project_data_dict = dict()
for worksheet in erection_input_worksheets:
erection_project_data_dict[worksheet] = project_data_dataframes[worksheet]

# Add the erection project data to the incomplete_input_dict
incomplete_input_dict['project_data'] = erection_project_data_dict



# Get the first set of data
incomplete_input_dict['rsmeans'] = project_data_dataframes['rsmeans']
incomplete_input_dict['site_facility_building_area_df'] = project_data_dataframes['site_facility_building_area']
Expand Down Expand Up @@ -429,7 +460,6 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
project_parameters['Breakpoint between base and topping (percent)']
incomplete_input_dict['fuel_usd_per_gal'] = project_parameters['Fuel cost USD per gal']
incomplete_input_dict['rate_of_deliveries'] = project_parameters['Rate of deliveries (turbines per week)']
incomplete_input_dict['turbine_spacing_rotor_diameters'] = project_parameters['Turbine spacing (times rotor diameter)']
incomplete_input_dict['depth'] = project_parameters['Foundation depth m']
incomplete_input_dict['rated_thrust_N'] = project_parameters['Rated Thrust (N)']
incomplete_input_dict['bearing_pressure_n_m2'] = project_parameters['Bearing Pressure (n/m2)']
Expand All @@ -440,6 +470,7 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
incomplete_input_dict['road_distributed_wind'] = True
else:
incomplete_input_dict['road_distributed_wind'] = False

incomplete_input_dict['site_prep_area_m2'] = project_parameters['Site prep area for Distributed wind (m2)']
incomplete_input_dict['road_length_adder_m'] = project_parameters['Road length adder (m)']
incomplete_input_dict['fraction_new_roads'] = project_parameters['Percent of roads that will be constructed']
Expand All @@ -448,7 +479,9 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
incomplete_input_dict['plant_capacity_MW'] = project_parameters['Turbine rating MW'] * project_parameters['Number of turbines']
incomplete_input_dict['row_spacing_rotor_diameters'] = project_parameters['Row spacing (times rotor diameter)']
incomplete_input_dict['user_defined_distance_to_grid_connection'] = project_parameters['Flag for user-defined home run trench length (0 = no; 1 = yes)']
incomplete_input_dict['distance_to_grid_connection_km'] = project_parameters['Combined Homerun Trench Length to Substation (km)']
incomplete_input_dict['distance_to_interconnect_mi'] = project_parameters['Distance to interconnect (miles)']
incomplete_input_dict['distance_to_grid_connection_km'] = project_parameters[
'Combined Homerun Trench Length to Substation (km)']
incomplete_input_dict['crew'] = incomplete_input_dict['project_data']['crew']
incomplete_input_dict['crew_cost'] = incomplete_input_dict['project_data']['crew_price']

Expand All @@ -468,7 +501,8 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
'Combined Homerun Trench Length to Substation (km)']

# Add inputs for transmission & Substation modules:
incomplete_input_dict['distance_to_interconnect_mi'] = project_parameters['Distance to interconnect (miles)']

#incomplete_input_dict['distance_to_interconnect_km'] = project_parameters['Combined Homerun Trench Length to Substation (km)']
incomplete_input_dict['interconnect_voltage_kV'] = project_parameters['Interconnect Voltage (kV)']
new_switchyard = True
if project_parameters['New Switchyard (y/n)'] == 'y':
Expand All @@ -488,6 +522,7 @@ def create_master_input_dictionary(self, project_data_dataframes, project_parame
incomplete_input_dict['overtime_multiplier'] = project_parameters['Overtime multiplier']
incomplete_input_dict['allow_same_flag'] = True if project_parameters['Allow same flag'] == 'y' else False


override_total_mgmt_cost_col_name = 'Override total management cost for distributed (0 does not override)'
if override_total_mgmt_cost_col_name in project_parameters and project_parameters[override_total_mgmt_cost_col_name] > 0:
incomplete_input_dict['override_total_management_cost'] = \
Expand Down Expand Up @@ -581,7 +616,6 @@ def apply_cost_and_scaling_modifications_to_project_parameters(self, project_par
hub_height_m = project_parameters['Hub height m']
flag_use_user_homerun = project_parameters['Flag for user-defined home run trench length (0 = no; 1 = yes)']
nameplate = project_parameters['Turbine rating MW']

distance_to_interconnect_mi = 0.0 if project_size_MW <= 20 else (0.009375 * project_size_MW + 0.625)
interconnect_voltage_kV = 0.4398 * project_size_MW + 60.204
new_switchyard_y_n = 'n' if project_size_MW <= 40 else 'y'
Expand Down
132 changes: 132 additions & 0 deletions landbosse/landbosse_api/API_test/API_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import os
from ..run import *
from unittest import TestCase


class TestLandBOSSE_API(TestCase):
def setUp(self):
self.file_path = os.path.dirname(__file__) + '/project_data/az_rolling.srw'
api_inputs = dict()
api_inputs['num_turbines'] = 100
api_inputs['project_id'] = 'foundation_validation_ge15'
self.results = run_landbosse(api_inputs)
print(self.results)

def test_total_BOS_cost(self):\
self.assertEqual(44208796.36106637, self.results['total_bos_cost'])

def test_total_management_cost(self):
delta = 0.002 # max % tolerance in expected and actual value
self.assertAlmostEqual(10570956.97,
self.results['total_management_cost'],
delta=int(delta * 10570956.97))

self.assertAlmostEqual(188371.90,
self.results['insurance_usd'],
delta=int(delta * 188371.90))

self.assertAlmostEqual(400723.14,
self.results['construction_permitting_usd'],
delta=int(delta * 400723.14))

self.assertAlmostEqual(1887763.492,
self.results['project_management_usd'],
delta=int(delta * 1887763.492))

self.assertAlmostEqual(336378.394,
self.results['bonding_usd'],
delta=int(delta * 336378.394))

self.assertAlmostEqual(4379646.689,
self.results['markup_contingency_usd'],
delta=int(delta * 4379646.689))

self.assertAlmostEqual(2071325,
self.results['engineering_usd'],
delta=int(delta * 2071325))

self.assertAlmostEqual(1306748.35,
self.results['site_facility_usd'],
delta=int(delta * 1306748.35))

total_management_cost = self.results['insurance_usd'] + \
self.results['construction_permitting_usd'] + \
self.results['project_management_usd'] + \
self.results['bonding_usd'] + \
self.results['markup_contingency_usd'] + \
self.results['engineering_usd'] + \
self.results['site_facility_usd']

self.assertAlmostEqual(self.results['total_management_cost'],
total_management_cost,
delta=int(delta * self.results['total_management_cost']))

def test_siteprep_cost(self):
self.assertEqual(self.results['total_sitepreparation_cost'], 3209538.616279147)
self.assertEqual(round(self.results['sitepreparation_equipment_rental_usd'], 2), 412013.84)
self.assertEqual(round(self.results['sitepreparation_labor_usd'], 4), 609463.1297)
self.assertEqual(round(self.results['sitepreparation_material_usd'], 4), 797751.5346)
self.assertEqual(round(self.results['sitepreparation_mobilization_usd'], 5), 83009.35197)
self.assertEqual(self.results['sitepreparation_other_usd'], 1307300.76)

total_siteprep_cost = self.results['sitepreparation_equipment_rental_usd'] + \
self.results['sitepreparation_labor_usd'] + \
self.results['sitepreparation_material_usd'] + \
self.results['sitepreparation_mobilization_usd'] + \
self.results['sitepreparation_other_usd']

self.assertEqual(self.results['total_sitepreparation_cost'], total_siteprep_cost)

def test_foundation_cost(self):
self.assertEqual(self.results['total_foundation_cost'], 10036157.011254452)
self.assertEqual(self.results['foundation_equipment_rental_usd'], 307553.56983444514)
self.assertEqual(round(self.results['foundation_labor_usd'], 3), 3677659.987)
self.assertEqual(round(self.results['foundation_material_usd'], 3), 5573031.216)
self.assertEqual(round(self.results['foundation_mobilization_usd'], 4), 477912.2386)

total_foundation_cost = self.results['foundation_equipment_rental_usd'] + \
self.results['foundation_labor_usd'] + \
self.results['foundation_material_usd'] + \
self.results['foundation_mobilization_usd']

self.assertEqual(self.results['total_foundation_cost'], total_foundation_cost)

def test_total_erection_cost(self):
self.assertEqual(6811700.7960274285, self.results['total_erection_cost'])
self.assertEqual(748911.4927891536, self.results['erection_equipment_rental_usd'])
self.assertEqual(5134653.8032382745, self.results['erection_labor_usd'])
self.assertEqual(0, self.results['erection_material_usd'])
self.assertEqual(0, self.results['erection_other_usd'])
self.assertEqual(28825.5, self.results['erection_fuel_usd'])
self.assertEqual(899310, self.results['erection_mobilization_usd'])

total_erection_cost = self.results['erection_equipment_rental_usd'] + \
self.results['erection_labor_usd'] + \
self.results['erection_material_usd'] + \
self.results['erection_other_usd'] + \
self.results['erection_fuel_usd'] + \
self.results['erection_mobilization_usd']

self.assertEqual(self.results['total_erection_cost'], total_erection_cost)

def test_total_gridconnection_cost(self):
self.assertEqual(4084775.152898776, self.results['total_gridconnection_cost'])

def test_total_collection_cost(self):
self.assertEqual(self.results['total_collection_cost'], 4869435.746468595)
self.assertEqual(self.results['collection_equipment_rental_usd'], 426614.6862960762)
self.assertEqual(self.results['collection_labor_usd'], 1402888.0267842393)
self.assertEqual(self.results['collection_material_usd'], 2808055.140699299)
self.assertEqual(self.results['collection_mobilization_usd'], 231877.89268898076)

def test_total_substation_cost(self):
self.assertEqual(4859182.072082901, self.results['total_substation_cost'])

def test_read_weather_data(self):
weather_data = read_weather_data(self.file_path)
self.assertEqual(len(weather_data), 8760)

def test_read_data(self):
input_dictionary = dict()
project_list = read_data(input_dictionary)
self.assertEqual(len(project_list.columns), 47)
Empty file.
Loading