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

Fixed python Materials enum invalid keys #214

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

Tom-Kingstone
Copy link
Contributor

@Tom-Kingstone Tom-Kingstone commented Jun 25, 2024

NOTE: Depends on

Issues addressed by this PR

Closes #213

When creating the enum, instead of calling sanitise_string, it calls the new method get_identifier which behaves similarly to sanitise_string, except it also excludes -, . and prepends _ when the identifier starts with a number.

Test files

try to get a material using the enum as follows:

from ladybugtools_toolkit.external_comfort.material import Materials
Materials.Material_12_in_Normalweight_Concrete_Floor

should return the material given properly.

Ensure that the Materials enum contains all the materials. (can tab through and compare to latest alpha/beta)

Changelog

Additional comments

@Tom-Kingstone Tom-Kingstone added the type:bug Error or unexpected behaviour label Jun 25, 2024
@Tom-Kingstone Tom-Kingstone requested review from tg359 and CKBoulter June 25, 2024 10:28
@Tom-Kingstone Tom-Kingstone self-assigned this Jun 25, 2024
Copy link

@CKBoulter CKBoulter left a comment

Choose a reason for hiding this comment

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

Fixes issue as now allows you to pull the material, however, it now removes those beginning with "_" when tabbing for materials list.

@Tom-Kingstone
Copy link
Contributor Author

Fixes issue as now allows you to pull the material, however, it now removes those beginning with "_" when tabbing for materials list.

this is likely due to python marking any values beginning with _ as private... I'm not sure what character to start the identifier with if it begins with a number if not _. "a_" would allow them to be visible, but not too sure on the UX of a_12_in_Normalweight_Concrete_Floor.

@Tom-Kingstone Tom-Kingstone requested a review from CKBoulter June 25, 2024 11:46
Copy link
Contributor

@jamesramsden-bh jamesramsden-bh left a comment

Choose a reason for hiding this comment

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

See commented code for requested changes

Tom-Kingstone and others added 2 commits June 25, 2024 13:11
will commit regex change locally as it should go after substitution

Co-authored-by: James Ramsden <james.ramsden@burohappold.com>
@jamesramsden-bh jamesramsden-bh self-requested a review June 25, 2024 12:17
Copy link

@CKBoulter CKBoulter left a comment

Choose a reason for hiding this comment

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

Changes worked. All materials which previously were hidden due to beginning with a _ are now showing in materials list beginning with "Material" in place of _. Pulls successfully.

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check required

Copy link

bhombot-ci bot commented Jun 25, 2024

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

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

There are 146 requests in the queue ahead of you.

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check unit-tests

Copy link

bhombot-ci bot commented Jun 25, 2024

@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 unit-tests

There are 72 requests in the queue ahead of you.

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Jun 25, 2024

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

  • check ready-to-merge

There are 70 requests in the queue ahead of you.

Copy link
Contributor

@jamesramsden-bh jamesramsden-bh left a comment

Choose a reason for hiding this comment

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

Requested changes now implemented

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Jun 25, 2024

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

  • check ready-to-merge

There are 153 requests in the queue ahead of you.

@jamesramsden-bh jamesramsden-bh merged commit cc8f242 into develop Jun 25, 2024
13 checks passed
@jamesramsden-bh jamesramsden-bh deleted the LadybugTools_Toolkit-#213-FixMaterialsEnum branch June 25, 2024 15:03
@BHoMBot BHoMBot mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Material pulling error in python
3 participants