Skip to content

Comments

add ascii sanitization and update safe name calls#53

Open
daryaguettler wants to merge 1 commit intomainfrom
feature/add-ascii-name-sanitization
Open

add ascii sanitization and update safe name calls#53
daryaguettler wants to merge 1 commit intomainfrom
feature/add-ascii-name-sanitization

Conversation

@daryaguettler
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.3%. Comparing base (8fdb73b) to head (050880f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
epinterface/sbem/common.py 81.8% 1 Missing and 1 partial ⚠️

❌ Your project status has failed because the head coverage (58.3%) is below the target coverage (90.0%). You can increase the head coverage or adjust the target coverage.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #53     +/-   ##
=======================================
+ Coverage   58.1%   58.3%   +0.1%     
=======================================
  Files         31      32      +1     
  Lines       4707    4725     +18     
  Branches     425     426      +1     
=======================================
+ Hits        2739    2755     +16     
- Misses      1835    1836      +1     
- Partials     133     134      +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


def _ascii_safe(s: str) -> str:
"""Return an ascii-only string suitable for idf names."""
return s.encode("ascii", "ignore").decode("ascii")
Copy link
Owner

Choose a reason for hiding this comment

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

Is it definitely ascii and not, say, utf-8 or some such that we want?

What does the ignore arg do?

"""
glazing_mat = SimpleGlazingMaterial(
Name=self.Name,
Name=self.safe_name,
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we have this change? Shouldn't Name be safe by default now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, see below comment. These two were using Name not safe_name, so I just updated to safe_name to stay in convention with the Name of the other objects. We can poentially remove safe_name altogether

)
infiltration_name = (
f"{target_zone_or_zone_list_name}_{self.safe_name}_INFILTRATION"
f"{target_zone_or_zone_list_name}_{self.Name}_INFILTRATION_Schedule"
Copy link
Owner

Choose a reason for hiding this comment

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

In fact, can we get rid of safe_name entirely now?

Are there negative implications of the renaming at the instance level?

My main fear is with references breaking in the IDF etc

Let's maybe review together in person at some pt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I originally removed safe_name from everywhere and just kept name in place there, since that class method should take care of the sanitization, but was worried it may break some logic so opted for the less invasive change for now. Let's discuss though!

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.

3 participants