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

Refactor vector3_t #1645 #1648

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Yogesh9000
Copy link
Contributor

refactored vector3_t and added a naive parse function

Copy link

github-actions bot commented Oct 5, 2024

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: python, java, webassembly.

Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 75.67568% with 9 lines in your changes missing coverage. Please review.

Project coverage is 96.80%. Comparing base (544ae70) to head (12ddb7b).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
library/public/types.h 75.67% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1648      +/-   ##
==========================================
- Coverage   96.85%   96.80%   -0.05%     
==========================================
  Files         108      104       -4     
  Lines        7691     7861     +170     
==========================================
+ Hits         7449     7610     +161     
- Misses        242      251       +9     

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

library/public/types.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
@@ -4,6 +4,10 @@
"type": "string",
"default_value": "+Y"
},
"up_direction2": {
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a test in TestSDKOption.cxx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what am I supposed to here exactly. there doesn't seems to be test for other options in TestSDKOption.cxx

{
throw options::parsing_exception("cannot parse " + str + " to a vector3_t");
}
int sign = +1;
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a logic based on regex working there:

if (std::regex_match(upString, match, re))

Feel free to copy it.
The advantage is it supports lowercase, omitting the + prefix, and errors out if invalid.

library/public/types.h Show resolved Hide resolved
library/testing/PseudoUnitTest.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
{
if (!py::isinstance<py::sequence>(src))
{
return false;
}
const py::sequence l = py::reinterpret_borrow<py::sequence>(src);
if (l.size() != S)
if (l.size() != 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

load array should support any number of values

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine here. If the array has more than 3 elements, it should fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, maybe I misunderstodd what this code is used for

library/public/types.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
library/public/types.h Outdated Show resolved Hide resolved
library/testing/TestSDKOptionsIO.cxx Outdated Show resolved Hide resolved
{
if (!py::isinstance<py::sequence>(src))
{
return false;
}
const py::sequence l = py::reinterpret_borrow<py::sequence>(src);
if (l.size() != S)
if (l.size() != 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine here. If the array has more than 3 elements, it should fail.

library/public/types.h Outdated Show resolved Hide resolved
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.

4 participants