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

Adapter methods: Serialisation to and from ladybug objects #142

Merged

Conversation

Tom-Kingstone
Copy link
Contributor

NOTE: Depends on

Issues addressed by this PR

Closes #136

Added the LadybugTools Adapter, with Pull and Push actions, that both use a LadybugConfig action config with a FileSettings property for a json file.

Pull:

This reads the contents of the json file, uses the BHoM serialiser to convert it into a dictionary (or custom object, depending on the layout of the json), checks against the "type" key in the dictionary and tries to convert the deserialised dictionary into a LadybugTools object of that type.

Push:

This takes in a LadybugTools object, and tries to convert it into a json serialised dictionary that can be read and deserialised into a ladybug readable python dictionary.

There were also some changes made to objects in the oM that might need handling in versioning_70.json and the versioning toolkit.

Test files

LBT_Tests.zip
Run this script using the serialised objects here:
Serialised objects.zip

Changelog

Additional comments

…t methods to make public objects easier to understand
…t methods to make public objects easier to understand
…arp?), and updated Read to use the new method
… Convert methods, and updated the description on the LBT adapter
… the keys so that they reflect what is expected python-side
…, and did a small refactor of the current oM objects (I fear the versioning for this PR greatly)
…ames to better reflect what the objects are used for
…override Name on objects that inherit BHoMObject)
@Tom-Kingstone Tom-Kingstone added size:L Measured in days type:feature New capability or enhancement labels Nov 22, 2023
@Tom-Kingstone Tom-Kingstone self-assigned this Nov 22, 2023
Copy link

bhombot-ci bot commented Nov 23, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check core has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check project-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check required

Copy link

bhombot-ci bot commented Nov 23, 2023

@Tom-Kingstone to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

Copy link

bhombot-ci bot commented Nov 23, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check project-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

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

Good work @Tom-Kingstone nice to get this over the line and deployed for alpha testing with the users

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning
@BHoMBot check compliance
@BHoMBot check required

Copy link

bhombot-ci bot commented Nov 23, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

Copy link

bhombot-ci bot commented Nov 23, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check project-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Nov 23, 2023

The check versioning has already been run previously and recorded as a successful check. This check has not been run again at this time.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: unit-tests

Copy link

bhombot-ci bot commented Nov 23, 2023

@FraserGreenroyd I have provided neutral checks to the checks requested. These checks will need to be run properly to obtain full results.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Nov 23, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check ready-to-merge

@FraserGreenroyd FraserGreenroyd merged commit 89b815a into develop Nov 23, 2023
@FraserGreenroyd FraserGreenroyd deleted the LadybugTools_Toolkit-#136-SerialisationRefactor branch November 23, 2023 22:48
@bhombot-ci bhombot-ci bot mentioned this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L Measured in days type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor serialisation of python inputs/outputs
3 participants