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

Migration of all EnergySystems and Solar/SolarTech Components to C# #722

Merged
merged 27 commits into from
Apr 6, 2022

Conversation

philipschulz
Copy link
Collaborator

@philipschulz philipschulz commented Mar 24, 2022

Migration of all EnergySystems and Solar/SolarTech Components to C#

Issues

Closes #697
closes #698

Description

  • All Components from the EnergySystems and Solar groups implemented in C#. Currently, both versions are available concurrently. To remove the python-versions, edit build and .nsi scripts so the python versions do not get built and installed.
  • Behaviour of SumOverTimePeriod is slightly different, the example in simple_pv.gh shows both versions and how the values have to be extracted slightly differently.

Checklist

@christophwaibel
Copy link
Contributor

@philipschulz as per discussion in our sprint today, can you clean up simple_pv.gh and notify me once done? Then, I'll review this PR (and merge it)

@philipschulz
Copy link
Collaborator Author

@christophwaibel cleaned up simple_pv.gh

Comment on lines 28 to 31
private void Load()
{
string[] lines = System.IO.File.ReadAllLines("../Resources/performance_ratio.csv");
lines = lines.Skip(1).ToArray();
Copy link
Contributor

Choose a reason for hiding this comment

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

This one causes a loading error. I assume, it works on your system because when you run it on debug mode, it references it from your development project folder, while, if you run Rhino regularly, it tries to look for it on the software installation folder (Program Files\Rhino...).
I am thinking, it would be better anyway to have the data be compiled into the .dll, instead of loading a csv everytime we open Grasshopper. Similar to how we do it in Hive.IO\EnergySystems: there are jsons that are compiled from csvs. And the solution compiles these jsons into the dll

Object: GhPerformanceRatioList (level 1)
{
  Ein Aufrufziel hat einen Ausnahmefehler verursacht.
  TargetInvocationException
}

Object: GhPerformanceRatioList (level 2)
{
  Ein Teil des Pfades "C:\Program Files\Rhino 6\Resources\performance_ratio.csv" konnte nicht gefunden werden.
  DirectoryNotFoundException
}

@philipschulz
Copy link
Collaborator Author

@christophwaibel Rewrote the PerformanceRatioList so that it loads from a compiled json instead of the csv :) Shouldn't crash anymore because of missing file paths

@christophwaibel
Copy link
Contributor

thanks @philipschulz , works fine now! merging

@christophwaibel christophwaibel merged commit c627373 into master Apr 6, 2022
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.

review all gh template files migrate honeybadger energy systems components to c#
2 participants