Conversation
…mported from PowerSystems (in PowerTableDataParser I copied over to the new repo the method for System that uses PowerSystemTableData). With this version of the repo, the tests do not pass, the error being that it cannot find a method for System(PowerModelsData). I'm pushing these changes in case we want to revert to this version of the repo and figure out how to solve this issue. Next I'll commit a working version of this repo that includes the System function defined in PowerSystems/src/parsers/powerflowdata_data.jl and PowerSystems/src/parsers/power_models_data.jl
… System for PowerModelsData and PowerFlowDataNetwork and the method is not included in PowerSystems. Also when I test this version of System I prefix it with the repo name. So when I import System and use it in this repo, I know its only using the methods for System that are unrelated to this repo. With this version I have all tests passing
PowerModelsData, PowerFlowDataNetwork, and/or their System methods from PSY. Add make_database()PowerModelsData, PowerFlowDataNetwork, and/or their System methods from PSY; add make_database()
| include("definitions.jl") | ||
| include("im_io.jl") | ||
| include("pm_io.jl") | ||
|
|
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| # making sure that database_name isn't an existing file | ||
| if isfile(database_name) || isfile(string(database_name, ".sqlite")) | ||
| error("database with this name already exists") | ||
| # creating database file name with .sqlite extension |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| # creating database file name with .sqlite extension | |
| # creating database file name with .sqlite extension |
| "sync_cond" => ThermalFuels.OTHER, | ||
| "geothermal" => ThermalFuels.GEOTHERMAL, | ||
| "ag_byproduct" => ThermalFuels.AG_BYPRODUCT, | ||
| ), |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| ), | |
| ), |
| function get_generator_mapping(filename::String) | ||
| genmap = open(filename) do file | ||
| YAML.load(file) | ||
| end |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| end | |
| end |
| gen = EnergyReservoirStorage | ||
| else | ||
| gen = getfield(PowerSystems, Symbol(gen_type)) | ||
| end |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| end | |
| end |
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
| THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| @test_logs( | ||
| (:error, r"cannot create Line"), | ||
| match_mode = :any, | ||
| @test_throws(badfiles[f], PowerFlowFileParser.System(PowerModelsData(pm_dict))) |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| @test_throws(badfiles[f], PowerFlowFileParser.System(PowerModelsData(pm_dict))) | |
| @test_throws( | |
| badfiles[f], | |
| PowerFlowFileParser.System(PowerModelsData(pm_dict)) | |
| ) |
| @testset "Parse PowerModel Matpower data files" begin | ||
| files = [ | ||
| x for x in readdir(MATPOWER_DIR) if | ||
| splitext(x)[2] == ".m" |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| splitext(x)[2] == ".m" | |
| splitext(x)[2] == ".m" |
| @test_logs( | ||
| (:error, r"cannot create Line"), | ||
| match_mode = :any, | ||
| @test_throws(badfiles[f], PowerFlowFileParser.System(PowerModelsData(pm_dict))) |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| @test_throws(badfiles[f], PowerFlowFileParser.System(PowerModelsData(pm_dict))) | |
| @test_throws( | |
| badfiles[f], | |
| PowerFlowFileParser.System(PowerModelsData(pm_dict)) | |
| ) |
Commit 7c03a81: this is a version of the parser where the function
Systemis solely imported fromPowerSystems(inPowerTableDataParser.jlI copied over to the new repo the method forSystemthat usesPowerSystemTableData). With this version of the repo, the tests do not pass, the error being that it cannot find a method forSystem(PowerModelsData)even though I'veimportedSystemin both main and test directories and left that version ofSystemdefined in PSY. I'm pushing these changes in case we want to keep thisSystemmethod in PSY. Corresponds to this commit in PowerSystems#hc/remove_powerflow_parser.Commits 419bdb6 and 9dc1335: this is the version of this repo that migrates the function methods
System(PowerModelsData)andSystem(PowerFlowDataNetwork)from PSY to this repo. When I test this migrated method forSystemI prefix it with the repo name so that I know I'm not using aSystemmethod from PSY (even though the version of PSY I import from here should not have thatSystemmethod anymore). All other times I callSystemwith a different method than defined in this repo, it should be usingSystemas defined in PSY. With this version I have all tests passing. Also added functionmake_databaseso that users can make a database from their system after it is parsed. Corresponds to this commit in PowerSystems#hc/remove_powerflow_parser.