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

General PR Patch #138

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

General PR Patch #138

wants to merge 7 commits into from

Conversation

9and3
Copy link
Contributor

@9and3 9and3 commented Oct 30, 2024

description

Various fixes and new features from testing DF in the evaluation of AugmentedCarpentry experimental campaign.

new features

  • new components DFExportResults, DFImportResults, DFInspectResults: I added the serialization of the result object so that it can be saved locally under the extension .diffCheck , shared and reloaded. This was needed when evaluating multiple elements and not having the need to have a .gh for each and re-run the results each time. This way this file can be lightweight and shared for repeatability.

  • new component DFSaveCloudToPLY: simple as that.

fixes

  • broken docs: I got rid of the component DF_cloud_cloud_distance since it was broken but it was still included in the publication
  • DFCsvExporter gh component distances export problem: we had a problem in exporting distances in one cell especially when exporting analysis data of large structures. In fact the limit of the csv of chars per cell is ~30k. To solve this problem, I added a separate toggle button to export distances as separate files but with id identification both in file naming and as a second column in the csv.
  • added automatic buttons for toggles for the DFCsvExporter gh component as an extra crunchy perk 🥫
  • fix gh component DFLoadCloudFromFile input checks to avoid errors + default scale value set to 1.0f

documentation

  • testing + documentation for the new components and modifications of python and c++ added

@9and3 9and3 added enhancement New feature or request dev patch cleaning labels Oct 30, 2024
@9and3 9and3 self-assigned this Oct 30, 2024
@9and3 9and3 marked this pull request as ready for review November 13, 2024 19:36
@9and3
Copy link
Contributor Author

9and3 commented Nov 13, 2024

hello @eleniv3d and @DamienGilliard , if you have the time to review or at least have a look and validate the new features would be great, no major breaking changes in it anyways. Cheers!

Copy link
Collaborator

@DamienGilliard DamienGilliard left a comment

Choose a reason for hiding this comment

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

Hi @9and3 , Thanks a lot for this pr. I just added 2 general remarks, both of which I can implement if you want. I still approved the PR in case we leave it like that.
Cheers !

)
toggle.Attributes.ExpireLayout()
gh.Instances.ActiveCanvas.Document.AddObject(toggle, False)
ghenv.Component.Params.Input[indx].AddSource(toggle) # noqa: F821


class DFCsvExporter(component):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi ! I didn't see a check on the number of character in a csv cell, to make sure the csv file is readable. Is it something that should be implemented later ? I can do it, no problem, but it's just to make sure we don't miss it. I guess we could simply add a warning to the component if the length of any of the "distances" of the row dictionnary is over the limit (for example 6553 distances if we keep 4 digits, because the limit is to 32767 in excel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is none because right now, the way it is we will never export a cell with a large number of chars. That was the only case of the "distances" cell. With this refactoring we are exporting the distances separate, each distance in a different row. So no need for a check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also we do not have CSV reader yet.


self.sanity_check = []
self.__serial_file_extenion: str = ".diffCheck"
Copy link
Collaborator

Choose a reason for hiding this comment

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

chic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

très 🕯️

raise e

@staticmethod
def load_pickle(file_path: str):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another general question: apparently pickle is "not secure" because it can unpack and execute code without safeguards. Do we leave it like that, do we add a small warning like "only load .diffcheck files you trust" ? I don't have the answer so maybe we should ignore my remark. I can implement the addition of the warning if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the remark, I think it's very pertinent what you are saying. A small constant RML grasshopper white box that does not disappear would actually not be enough. Let me see if I can use JSON instead without much work. Good point though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants