Comments (14)
Hi,
can you add test files, add the test to e.g. test_code_generator and open a PR?
from autowrap.
Does it work with more basic instantiation? E.g. # ScoreTypeRef := IteratorWrapper[A]
from autowrap.
It looks like it doesn't work with the more basic instantiation either. Looking at our existing codebase it looks like wrap-instances
are only used locally, so it may be this issue has never come up.
from autowrap.
ahh hmm that might also be the cause, yes. Can you check if it works locally in the same pxd file?
from autowrap.
Is a cimport for ScoreTypeRef generated in the b.pxd file?
from autowrap.
It appears to not work even in the same pxd file (though it's necessarily in a different cdef extern from
block on account of coming from different cpp files)
from autowrap.
Yup.
from autowrap.
There is a similar test for this in autowrap already. There we just explicitly specify the instantiation again.
autowrap/tests/test_files/templated.pxd
Line 45 in 04192b9
from autowrap.
Probably only "cppclass"es can be put as template parameter. And the instantiation is already a cython "class".
from autowrap.
So at least in the triply nested case libcpp_vector[ IteratorWrapper [ libcpp_set [ ScoreType ] ] ] assigned_scores
this fails.
from autowrap.
Probably only "cppclass"es can be put as template parameter. And the instantiation is already a cython "class".
libcpp_vector[ IteratorWrapper [ libcpp_set [ String ] ] ] assigned_scores
also fails, so I think its probably how deeply nested these are allowed.
from autowrap.
yes I can confirm.
self = <autowrap.Types.CppType object at 0x113478700>
typemap = {'T': <autowrap.Types.CppType object at 0x113703520>, 'T2': <autowrap.Types.CppType object at 0x113703910>, 'Templated': <autowrap.Types.CppType object at 0x113703040>, 'Templated_other': <autowrap.Types.CppType object at 0x113703700>, ...}
indent = 0
def _transform(self, typemap, indent):
aliased_t = typemap.get(self.base_type)
if aliased_t is not None:
if self.template_args is not None:
if aliased_t.template_args is not None:
map_ = printable(typemap, "\n ")
m = "invalid transform of %s with:\n %s" % (self, map_)
> raise Exception(m)
E Exception: invalid transform of Templated[libcpp_vector[T]] with:
E T -> _T
E T2 -> _T2
E Templated -> _Templated[_T]
E Templated_other -> _Templated[_T2]
E Y -> _Y
E Z -> _Z
autowrap/Types.py:92: Exception
from autowrap.
What if you introduce (c)typedefs for now? Let me try
from autowrap.
What if you introduce (c)typedefs for now? Let me try
That at least gives us a more detailed error message:
Exception: Recursion in std::vector<T> is not implemented for other STL methods and wrapped template arguments
from autowrap.
Related Issues (20)
- [Typing] Remaining mini issues
- 22.9 chokes on templated vector HOT 6
- Overloaded method docstrings don't indent properly HOT 1
- Use inheritance instead of assignment for "attached" classes
- Re-evaluate default docstrings HOT 1
- Typehint issues
- Evaluate if wrapping functions that accept std::function (callbacks) are easily possible
- named parameters possible? HOT 2
- Do not use list as pair replacement, since list cannot be heterogenously typed
- How to handle unnamed parameters in typestubs
- Remove all python2 special handling cases
- ConversionProviders for libcpp_container[libcpp_*_string, *] not picked up -> Careful with typing
- Autoapply reformating in CI?
- release-autowrap.yaml need updating
- Adapt docstring generation regarding inheritance
- [Typestubs] Declare classes that implement iterators as Iterable
- add wrap-return-self to change default behavior from returning a copy to a reference HOT 1
- Rewrite generation of _get_item_
- Generate __str__ and __repr__
- Multiline comment parsing update breaks things HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autowrap.