EnergyEconomyDecoupling / PFUPipeline

Primary, Final, and Useful energy and exergy for 1960-2019
https://energyeconomydecoupling.github.io/PFUPipeline/
Other
3 stars 0 forks source link

Error - generate_etas_fu_template #4

Closed ZekeMarshall closed 4 years ago

ZekeMarshall commented 4 years ago

Hi Matt, thanks for sorting this. I've updated matsbyname and both r_make() and vis_drake_graph() are now executing correctly. However, when i run generate_eta_fu_template("World") I receive the following error: Error in dir.create(output_folder, showWarnings = FALSE) : invalid 'path' argument. I also receive this error when calling the generate_eta_fu_template() function for ESP and PRT. On the other hand generate_fu_allocation_template is executing OK for all countries. Is this an error on my end?

MatthewHeun commented 4 years ago

I see the same error.

One reason for this problem there are no tests for this code, because PFU-Database is not a package. For a couple weeks now, I have been thinking that it would be good to convert PFU-Database into a drake-style package. (In fact, I already have a branch called "package" on which I have been working on that conversion.) This bug is convincing me that I should do the conversion sooner rather than later!

My plan for this afternoon is as follows: 1) Convert PFU-Database to a package. 2) Develop a test that fails due to this bug. 3) Fix the bug so that the test works.

We'll see how far I get!

ZekeMarshall commented 4 years ago

Sounds good. Let me know how it goes and if you need me to test anything!

MatthewHeun commented 4 years ago

I think I got this working. At least I now get to the point where an error is thrown:

Error: Not all C values are between 0 and 1 in eta_fu_template.

Let me know if it works for you.

Note that I made a "hotfix" to the master branch. I have not yet converted the PFU-Database repository to be a package.

ZekeMarshall commented 4 years ago

Thanks Matt. I have now fixed the World FU allocations table so all the allocations are correct and sum to 100% for each Machine & Eu.product combination. Running generate_eta_fu_template("World") now generates the World FU etas Template successfully!