-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Now passing strings to mimetypes.guess_extension. #553
Conversation
46bf53e
to
95d36b2
Compare
c0ab930
to
16bc54f
Compare
So, I think the remaining failure is unrelated (a fluke?). From my point of view, this is ready to go. |
pyvo/dal/sia.py
Outdated
@@ -903,7 +903,7 @@ def suggest_dataset_basename(self): | |||
out = re.sub(r'\s+', '_', out.strip()) | |||
return out | |||
|
|||
def suggest_extension(self, *, default=None): | |||
def suggest_extension(self, *, default='img'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why img
? I've noticed same assumption in suggest_dataset_basename
.
On Fri, Jun 14, 2024 at 03:12:32PM -0700, Adrian wrote:
@andamian commented on this pull request.
> @@ -903,7 +903,7 @@ def suggest_dataset_basename(self):
out = re.sub(r'\s+', '_', out.strip())
return out
- def suggest_extension(self, *, default=None):
+ def suggest_extension(self, *, default='img'):
Just curious why `img`? I've noticed same assumption in
`suggest_dataset_basename`.
I'm not particularly married to "img", and now that you mention it,
since this is not only for SIAP (and hence images), I notice it may
if fact not be particularly appropriate. I certainly have no strong
preferences, except the None we have now seems a choice that will
confuse our users more than just about anything else. What about
"dat"? "bin"? "octets"? "data"?
|
16bc54f
to
17ac11e
Compare
There is "dat" as a non-informative default extension elsewhere in pyvo, so that's what I'm going for now. |
(test failures were a glitch on a remote service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a test for original_row
, and its setter method? As far as I see it doesn't come up with any of the tests.
pyvo/dal/adhoc.py
Outdated
note the table row this DatalinkResults instance was generated | ||
from. | ||
|
||
This is mostly for pyVO-internal use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given this, should this be prepended with an _
?
OK, looking at the other PRs and discussions, and the commit history here, I think that the So, I'll make a backup of the current branch, but then will go ahead and remove those changes from this PR and merge it as the rest are fully finished with test and addressed review. |
Also changing the default extension to .dat (from None). Also, whatever was originally implementing mime2extension did not include the leading dot that mimetypes includes. We are doing away with that, too. This is supposed to address bug astropy#552.
17ac11e
to
3f3e89f
Compare
The backup commit is here: e2cdd91 |
Thank you @msdemlei! (I mark this for backport, in case we have 1.5.3 coming out sooner than 1.6) |
On Thu, Jun 27, 2024 at 01:59:33PM -0700, Brigitta Sipőcz wrote:
@bsipocz commented on this pull request.
Can we have a test for `original_row`, and its setter method? As
far as I see it doesn't come up with any of the tests.
Sorry that that code appeared in this PR in the first place -- I was
juggling a few too many branches at that moment. In the actual PR
that this stuff belongs to, #559, the setter method is (fortunately)
gone, and there are some basic tests for the main code paths
involving original_row, too.
|
Now passing strings to mimetypes.guess_extension.
Also changing the default for images to .img (from None).
This is supposed to address bug #552.
Fixes #552