Skip to content

Python Library revisions to be more compatible with the new data structure and other application changes. - #7

Merged
gonzalocasas merged 178 commits into
mainfrom
ReleaseRevisions
Jun 23, 2024
Merged

gonzalocasas merged 178 commits into
mainfrom
ReleaseRevisions

Conversation

@jckenny59

@jckenny59 jckenny59 commented Apr 22, 2024 •

Copy link
Copy Markdown
Collaborator

The series of changes are primarily focused on the realtimedatabase and storage modules. The majority of the changes are focused in the pyrebase, cli, and interface . Additionally, changes in the assemblies module for removal of unnecessary things, and the adjustment of old methods to match new data types & structures.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

jckenny59 and others added 30 commits September 29, 2023 12:23
This push includes creating a new firebase and testing pushing data to the firebase by loading the config from the .json data exported from GH.
This includes constructing the correct file path for the getting the correct file path to load the config .json in the realtime DB
Includes remapping to the proper modules from the folder and connecting to the proper elements. It also includes adding sample .json structures to the repo for testing uploads and structure.
This includes updating additional elements for firebase and further refinement of included files
Updating compas_xr functions to a larger class structure
Writing RealtimeDatabase class and Storage Class and writing accessing them via proxy... Also writing different data structures for firebase upload
testing access of class from proxy.
Rename upload and download
Push to firebase storage worked, but froze gh. event needs to be refined with its implementation.
updating dependencies folder, and begining download function
set up of .ghx for download function
Updating storage download file and testing different threading options for returning download url
This push includes many different edits....

1. Updating all proxy methods
2. Working event methods working through starting new thread and changing event waiting method (download file working) need to implement new functions for download data and etc. as well as testing event implementation with the upload.
Updating.ghx it was accidentally on the local version
upload file and download file working for compas_xr.Storage
Upload and download assembly for the new class working.
This push includes all working functions storage_cli and assembly works for both timber assembly, and updates gh components in t2_demo_model_testing.ghx

1. upload and download file
2. upload and download assembly
3. upload and download data
Upload to realtime database from json working
Update realtimeDB writing for individual paramaters in the class structure.
@jckenny59
jckenny59 marked this pull request as ready for review May 10, 2024 07:31

@gonzalocasas gonzalocasas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry that this took forever and a bit more, in general it looks good to me, I added quite some feedback here and there but we can decide what needs to be tackled and what can be postponed

Comment thread requirements.txt Outdated
@@ -0,0 +1,5 @@
compas >=2.0.4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally, add an upper bound too, e.g. compas >=2.0.4,<3

self.project_name, self.storage_folder, self.z_to_y_remap, self.storage_bucket
)

def __data__(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to half-way implement the data protocol of compas, it's not inheriting from compas.data.Data, and the __data__ property does not have the @property decorator

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#10

self.api_key, self.auth_domain, self.database_url, self.storage_bucket
)

def __data__(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same thing with the data protocol

current_data["priority"] = priority
self.database.upload_data_to_deep_reference(current_data, database_reference_list)

def visualize_project_state_timbers(self, timber_assembly, project_name):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't get this name.. why does it end with timbers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is because I was planning on trying to use the BrepGeometryConsumer from timbers, but it didn't work out in the end. Since it only returns Box's, I think that it can be removed and simply use visualize_project_state method for all assembly types. :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is because I originally I wanted to use the BrepGeometryConsumer from timbers so I can return the actually geometry, but It did not work very well, and this evolved to being almost the same as visualize_project_state. This method can be removed and simply use visualize_project_state for all Assemblies. :)

assembly_element_id = step.element_ids[0]
# TODO: Tried to write like this, but find_by_key returns a NoneType object
"""
part = timber_assembly.find_by_key(assembly_element_id)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs to be checked with Chen

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I also had a problem with this in normal assemblies after checking later I believe :(

Comment thread src/compas_xr/ghpython/app_settings.py Resolved
@gonzalocasas

Copy link
Copy Markdown
Member

As a general one, please run invoke lint locally so that you can fix the styling errors before they get reported by the build process

@gonzalocasas
gonzalocasas changed the base branch from MAST2_CompasXR to main June 11, 2024 15:34
@gonzalocasas
gonzalocasas merged commit 82337e7 into main Jun 23, 2024
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.

2 participants