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

fixed the get_cashflow_loc, and added the get_farm_loc #172

Closed
wants to merge 3 commits into from

Conversation

wanghy-anl
Copy link
Contributor


Pull Request Description

What issue does this change request address?

fixed the get_cashflow_loc in heron/src/_utils.py, and added the get_farm_loc

What are the significant changes in functionality due to this change request?

developer can get TEAL location and FARM location for use.


For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

  • 1. Review all computer code.
  • 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual and xsd schema. If the input syntax change deprecates existing input files, a conversion script needs to be added (see Conversion Scripts).
  • 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
  • 4. Automated Tests should pass.
  • 5. If significant functionality is added, there must be tests added to check this. Tests should cover all possible options. Multiple short tests are preferred over one large tes.
  • 6. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change. The requirements and the requirements test shall be in sync.
  • 7. The merge request must reference an issue. If the issue is closed, the issue close checklist shall be done.
  • 8. If an analytic test is changed/added, the the analytic documentation must be updated/added.
  • 9. If any test used as a basis for documentation examples have been changed, the associated documentation must be reviewed and assured the text matches the example.

Copy link
Collaborator

@PaulTalbot-INL PaulTalbot-INL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes are consistent with standards and look useful.

The trailing whitespace on line 50 of _utils as well as the development attribution on line 57 should be removed; trailing whitespace fails checks, and the attribution will by tracked by git so we don't need to add it to the code base.

@wanghy-anl
Copy link
Contributor Author

Paul, I also changed the Line 26 on DispatchManager.py, so the cashflow_path can correctly catch the TEAL path. Please check if I made it right. Is there any other code using this method "get_cashflow_loc"?
Thanks,
Haoyu

@@ -23,7 +23,7 @@
sys.path.append(raven_path)
sys.path.pop()

cashflow_path = os.path.abspath(os.path.join(hutils.get_cashflow_loc(raven_path=raven_path), '..'))
cashflow_path = os.path.abspath(hutils.get_cashflow_loc(raven_path=raven_path))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change concerns me; we should have lots of failing tests currently if this change is needed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as expected, these are the test results:

  File "/home/civet/civet/build_0/HERON/templates/template_driver.py", line 25, in <module>
    CF_LOC = hutils.get_cashflow_loc(raven_path=RAVEN_LOC)
  File "/home/civet/civet/build_0/HERON/src/_utils.py", line 52, in get_cashflow_loc
    plugin_handler = importlib.import_module('plugin_handler')
  File "/home/civet/miniconda3/envs/raven_libraries/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'plugin_handler'
 ... Errors were encountered while running HERON.

Running test failed with exit code 1
(19F16/23) Failed (  2.97sec)/home/civet/civet/build_0/HERON/tests/integration_tests/workflows/storage/Storage
(20F16/23) Success(  0.36sec)/home/civet/civet/build_0/HERON/tests/unit_tests/component
(21F16/23) Success(  0.35sec)/home/civet/civet/build_0/HERON/tests/unit_tests/ValuedParams/parametric
SKIPPED ({'heavy'} is not a subset of {'normal'})
(22F16/23) Skipped(  None!  )/home/civet/civet/build_0/HERON/tests/workshop/htse/example1_simple/Workshop_HTSE_Simple1
FAILED:
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/ROM_source/ROMSource
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/cashflows/Cashflows
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/debug_mode/DebugMode
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/hybrid_load/CashFlows_Run
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/labels/Labels
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/min_demand/MinDemand
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/multimarket_fix_price/MultimarketFixPrice
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/multirun_sweep_opt/MultiRun_Sweep
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/optimization_settings/OptimizationSettings
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/pyomo_options/PyomoOptions
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/storage_func/StorageFunc
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/validator/ValidatorExample
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/var_demand_fix_price/VarDemandFixPrice
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/var_demand_var_price/VarDemandVarPrice
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/workflows/production_flex/ProductionFlex
Failed /home/civet/civet/build_0/HERON/tests/integration_tests/workflows/storage/Storage

PASSED: 3
SKIPPED: 3
FAILED: 16
... there were failed tests for plugin HERON!

@wanghy-anl wanghy-anl mentioned this pull request Jun 5, 2022
9 tasks
@PaulTalbot-INL
Copy link
Collaborator

Closed in favor of #175.

@wanghy-anl wanghy-anl deleted the getLocationUpdate branch June 8, 2022 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants