Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Develop add python property access #750

Merged
merged 29 commits into from
Sep 25, 2020

Conversation

dchassin
Copy link
Member

@dchassin dchassin commented Sep 19, 2020

This PR adds support for direct access to object properties. The property class in Python offers a significant performance enhancement over using converted access using the gridlabd module’s get_value() and set_value() accessors.

In the example provided in the documentation, using gridlabd.get_value('my_example','my_real') instead prop.get_value() took about 8 times longer. This enhancement is critical for all modules, classes, and objects that use sync event handlers.

Current issues

  1. Get and set accessors do not support automatic unit conversion using fast unit references (only strings are supported).

Code changes

  • Add support for python_property type.
  • Add support for python type.
  • Add example.
  • Fix python memory management problems.

Documentation changes

Test and Validation Notes

  • Add gldcore/autotest/test_python_property.{glm,py}

@dchassin dchassin added the enhancement Request an enhancement or new feature label Sep 19, 2020
@dchassin dchassin added this to the HiPAS Final Implementation milestone Sep 21, 2020
@aivanova5 aivanova5 merged commit d631803 into develop Sep 25, 2020
@aivanova5 aivanova5 deleted the develop-add-python-property-access branch September 25, 2020 22:55
dchassin pushed a commit that referenced this pull request Sep 28, 2020
* Develop (#2)
* Update version.h
* Add support for python properties (#748)
* Move subcommand help tests to autotest folder (#747)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Develop add optimize module (#746)
* Add optimize module
* Add optimize module
* Remove CSV output from optimize module
* Change optimize extremum test to optional
* Rename test_extremum_opt.glm to test_extremum.glm
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Develop fix rusage format error and add global rusage data (#745)
* Fix rusage format error and add global rusage data
* Add rusage_data doc
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Add server control halt and stop commands (#752)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update Library.md (#753)
* Update load.cpp (#751)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update Glm_save_options.md (#755)
* Develop add python property access (#750)
* Add support for python properties
* Finalized basic python property object implementation
* Add example
* Update Property.md
* Delete Stochastic variables.ipynb
* Add support for property comparisons
* Update example
* Fix property type structure init
* Merge remote-tracking branch 'origin/develop-fix-load-phase-tautology' into develop-add-python-property-access
* Add support for unit conversion in python property
* Document python property unit conversion and fix ambiguous method name
* Workaround for python finalize exception
* Update python_embed.cpp
* Update Property.md
* Update Property.md
* Update test_python_property.glm
* Fix problem with modlist in python event handler
* Update main.cpp
* Added python shadow class tutorial
* Fix json2png it can plot csv data by default
* Create tmy32glm.py
* Update Makefile.mk
* Update Python shadow class tutorial.ipynb
* Fix traceback issues
* Update thermostat.py
* Update Python shadow class tutorial.ipynb
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Create c-cpp.yml
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update README.md
* Update master.yml
* Update and rename test_require_pwlf.glm to test_require_pytz.glm
* Update develop.yml
aivanova5 added a commit that referenced this pull request Sep 28, 2020
* Create c-cpp.yml

* Fix action for master and develop (#759)

* Develop (#2)
* Update version.h
* Add support for python properties (#748)
* Move subcommand help tests to autotest folder (#747)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Develop add optimize module (#746)
* Add optimize module
* Add optimize module
* Remove CSV output from optimize module
* Change optimize extremum test to optional
* Rename test_extremum_opt.glm to test_extremum.glm
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Develop fix rusage format error and add global rusage data (#745)
* Fix rusage format error and add global rusage data
* Add rusage_data doc
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Add server control halt and stop commands (#752)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update Library.md (#753)
* Update load.cpp (#751)
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update Glm_save_options.md (#755)
* Develop add python property access (#750)
* Add support for python properties
* Finalized basic python property object implementation
* Add example
* Update Property.md
* Delete Stochastic variables.ipynb
* Add support for property comparisons
* Update example
* Fix property type structure init
* Merge remote-tracking branch 'origin/develop-fix-load-phase-tautology' into develop-add-python-property-access
* Add support for unit conversion in python property
* Document python property unit conversion and fix ambiguous method name
* Workaround for python finalize exception
* Update python_embed.cpp
* Update Property.md
* Update Property.md
* Update test_python_property.glm
* Fix problem with modlist in python event handler
* Update main.cpp
* Added python shadow class tutorial
* Fix json2png it can plot csv data by default
* Create tmy32glm.py
* Update Makefile.mk
* Update Python shadow class tutorial.ipynb
* Fix traceback issues
* Update thermostat.py
* Update Python shadow class tutorial.ipynb
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Create c-cpp.yml
Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
* Update README.md
* Update master.yml
* Update and rename test_require_pwlf.glm to test_require_pytz.glm
* Update develop.yml

* Delete c-cpp.yml

* Update develop.yml

* Update develop.yml

* Update and rename develop.yml to validate.yml

* Delete master.yml

* Rename validate.yml to develop.yml

* Update and rename develop.yml to master.yml

* Create develop.yml

Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
@aivanova5 aivanova5 mentioned this pull request Sep 28, 2020
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Request an enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants