Skip to content

DataAlgo : Move to dedicated namespace - #1561

Open
johnhaddon wants to merge 2 commits into
ImageEngine:mainfrom
johnhaddon:dataAlgoNamespace
Open

johnhaddon wants to merge 2 commits into
ImageEngine:mainfrom
johnhaddon:dataAlgoNamespace

Conversation

@johnhaddon

Copy link
Copy Markdown
Member

I've been finding things like IECore::size() and IECore::trait() kindof unobvious, and I think moving them to a namespace helps with that.

@johnhaddon

Copy link
Copy Markdown
Member Author

Would be good to get some eyes on this please @murraystevenson.

@murraystevenson murraystevenson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apologies, forgot about this one. The mechanical changes all look good to me, and it makes sense to move these to a dedicated namespace. I've noted a few thoughts inline, feel free to address how you see fit and squash in any changes so this is ready to merge.

Comment on lines +59 to 65
def( "getGeometricInterpretation", &IECore::DataAlgo::getGeometricInterpretation );
def( "setGeometricInterpretation", &IECore::DataAlgo::setGeometricInterpretation );

def( "uniqueValues", &uniqueValues );
def( "uniqueValues", &IECore::DataAlgo::uniqueValues );

def( "size", &IECore::size );
def( "size", &IECore::DataAlgo::size );
def( "address", &addressWrapper );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For consistency, is it worth moving these into IECore.DataAlgo while we're at it?

@johnhaddon johnhaddon Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Definitely - squashed into 946bb89, and adjusted the tests to match in 225fd0e.

Comment thread Changes Outdated
Comment on lines +4 to +7
Improvements
------------

- DataAlgo : Moved all functionality into an `IECore::DataAlgo` namespace.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we're targeting main, this should be under 10.x.x.x.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also squashed into 946bb89.

Comment thread include/IECore/DataAlgo.h
Comment on lines +112 to +114
// Temporary backwards-compatibility with earlier non-namespaced version.
/// \todo Remove
using namespace DataAlgo;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we considering the old IECore:: names deprecated? If so, should that be announced in Changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep - also in 946bb89.

With a `using` fallback so folks don't have to adapt right away. Technically this is still a source compatibility break though, as the USD changes show - it's possible for ambiguity to exist with pre-existing DataAlgo namespaces in other libraries.
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