-
Notifications
You must be signed in to change notification settings - Fork 1
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
overhaul output dimension initialization #16
Comments
This might be none of my business, but did you mean to version-bump on the |
kind of ... in preparation for merging & releasing, but then got distracted. |
@mohawk2 Is there a good way to detect whether an output PDL was passed as Details
So far, it seems that if I pass in Can those 2 cases (explicitly allocated dimension of size 1 vs. |
... after looking at the Lines 64 to 68 in 4126ab2
@mohawk2 can you confirm that this is the recommended way of checking what I want to be checking (i.e. that both |
I am a bit surprised that these n-dimensional sparse objects really do vary in the number of indices each one has? But I guess that's the nature of the sparseness varying between sections of the notional fixed-size object. That is currently the best known way of doing this. I've had a stare at the code you kindly linked to in On that note, I'm hoping that the "type variable" thing you feel is fully sorted out? To recap, I believe the answer to that issue was the "implied type" (left off the |
@mohawk2 thanks for the reply! I'll continue on this basis then.
Yes, I agree that's not necessary here as long as we can nail down
for ufuncs at least yes ... there's no good (and efficient) way to know how many non-missing values a |
Great!
That makes sense! I think that until such time as PDLPorters/pdl#418 gets addressed, we have to accept the limitations of PDL only handling rectangular data. |
@mohawk2 I think that 172be81 checks all of the above boxes for the ufuncs:
... I also looked into your other suggestions from #6 (comment) :
done, and thanks for the tip -- the PP code is much cleaner this way!
I tried this, and it does work for the "low-level" I also tried to get rid of the
These are emitted when evaluating They're "just" warnings, so I'm not too bothered, but wonder if you might have an idea how I might get rid of them. |
Great work in deleting code! Regarding that "redefined" warning, which version of PDL are you using? You can get more information on exactly where that's triggered by changing It may also be relevant that when I do |
Confirmed, sorry for the noise. I got warnings under both PDL v2.081 and v2.091, but they're gone under current git master v2.095 PDLPorters/pdl@95be933. Also, thanks for the
That should be fixed by moocow-the-bovine/PDL-Cluster@646da1a ... the problem was 2 calls to
It might very well not be necessary or useful anymore. I believe that the "overly clever" (aka "ugly") stuff is there in order to allow:
... it also used to take care of generating & distributing PODs from All of that said, I think the Right Thing To Do™ would be to replace |
I believe you are trying to solve two fairly different problems with one Great Big Solution:
For both, you can just symlink While comparison can be the thief of joy, MetaCPAN says you have 9 PDL distros. I maintain rather more than that, especially with the recent burst of carving out those no longer belonging in main PDL. I am fanatically lazy, and yet have felt no need to make a Great Big Solution to the above two problems. I'm not telling you how to run your distros, but I am telling you how I run mine. |
@mohawk2 another question regarding checking for null args in $PDL(myOutputPdl)->state & PDL_MYDIMS_TRANS ... it seems that this can evaluate to true even if pp_def('myFunc',
Pars => q{
myInputPdl(Nin);
indx [o] myOutputPdl(Nout);
},
RedoDimsCode => q{
if ( $PDL(myOutputPdl)->state & PDL_MYDIMS_TRANS ) {
fprintf(stderr, ">>> setting default output dimension <<<\n");
$SIZE(Nout) = $SIZE(Nin);
}
},
...
); ... I'm seeing the the Is there a better way to check for "real" |
I believe checking Also, I still don't see why you are trying to keep these two sizes as independent variables. Please make sure this actually makes sense. If it does, then the way is to have an EDIT: a further benefit of passing the size in as an actual parameter is that PDL, as well as doing the allocating, can get the right type, and also automatically include the broadcast dimensions. |
I had a look at the latest pushed code, because the stuff you're dealing with here is pretty fundamental and I'm very interested both out of curiosity, and to see if there are features that PDL needs to add. One example is the ragged-array idea, as mentioned already. A couple of thoughts I had: in
doesn't do bounds-checking? And in
should definitely use the type |
That works in
Because I was really just printf-ing through an
Because they are logically independent, and I have in the past wanted/needed that independence & explicit pre-allocation when working with large structured sparse matrices (e.g. a
I have been adding in optional
Trying to avoid that. |
You mean ensuring that
good catch, thanks! that line is probably from pre- |
One thought I've just had: I see that (wisely) you're adding tests for stuff as you go. If those are for stuff that already works, I'd advocate putting them on |
yes, I admit that would be a better procedure. I'm not going to be doing that (this time around at least) due to limits on (a) my working memory & (b) my TUIT allowance.
fwiw, I think the messy git history is much still an improvement over my bad old muscle-memory habit of |
Your willingness to do best practice is going to have an effect on observers' willingness to:
As always, it's up to you ;-) |
Let's pretty-please-with-sugar-on-top all-caps-really-I-mean-it NOT get into that discussion here.
... and others' decisions about whether, how, & in what manner they choose to use and/or engage with my code are -- as always -- their decisions. I'm not selling anything. |
closing as resolved in PDL-CCS v1.24.0 |
originally discussed in and around
TODOs:
RedoDimsCode
null
instead ofzeroes
to initialize output PDLsPMCode
wrappers, dropping them wherever possibleThe text was updated successfully, but these errors were encountered: