-
Notifications
You must be signed in to change notification settings - Fork 392
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
update for neptune 1.0 #934
update for neptune 1.0 #934
Conversation
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.
skorch/skorch/callbacks/logging.py
Lines 260 to 265 in 909f4d5
try: | |
# neptune-client=0.9.0+ package structure | |
from neptune.new.types import File | |
except ImportError: | |
# neptune-client>=1.0.0 package structure | |
from neptune.types import File |
Update based on the decided approach.
@kshitij12345 Thanks for the PR. Are you with Neptune? |
Hi @BenjaminBossan, Yes. I am with Neptune. Currently the PR is in draft and have asked other members to do a preliminary review. Once it is ready, I will mark this ready and ping you. Does that work? Thanks! |
Okay, great, that works. I only asked to ensure that folks at Neptune are okay with dropping support for the old client. |
try: # >1.0 package structure | ||
from neptune.handler import Handler | ||
except ImportError: # <1.0 package structure | ||
from neptune.new.handler import Handler |
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.
This can be just
from neptune.handler import Handler
given that the dependency is v >=1.0.0
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.
This is actual logging code which should be compatible with both pre and post 1.0.
Other update where we assume 1.0 structure is in test (where we have updated the requirements to install latest version).
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.
But the requirements say neptune
hence >=1.0.0, so there is no backward compatibility assumed.
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.
That is the requirements for development. Installing skorch
as a user doesn't install neptune. So we could have users who may use older neptune-client.
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.
Is all the code compatible with older versions? E.g. the use of append
instead of log
. If not, there is no point in having this check.
I think it's fine to tell users to install the latest version of neptune
(except if you know that users are reluctant to upgrade versions). E.g. when this class is initialized, there could be a version check and a helpful error message when the version is too low. WDYT?
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
I got an error in a CI run that seems to be related to Neptune:
https://github.com/skorch-dev/skorch/actions/runs/4436004355/jobs/7783884283#step:6:107 My first guess would be that it's caused by a new neptune version. The installed version is |
Yes, this is due to new version and this PR should fix the issue. |
Great, thanks for letting me know. I don't want to rush this PR, but since CI is currently broken, do you think it will be done soon? Else, I would restrict the neptune version to make CI pass again. |
I think the PR is ready. @AleksanderWWW for a final review. Thank you! |
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.
LGTM @kshitij12345 :) The updated imports should resolve the CI issue
@BenjaminBossan this should be ready for your review and merging :) |
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.
Thanks a lot for the update. Very nice results on Neptune.
Overall, this is almost good to go, just a few comments, please take a look.
>>> import neptune.new as neptune | ||
>>> from neptune.new.types import File | ||
>>> import neptune | ||
>>> from neptune.types import File |
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.
I checked the example and found an issue which was already there before but should still be fixed:
- neptune_logger.run["checkpoints].upload_files("./checkpoints")
+ neptune_logger.run["checkpoints"].upload_files("./checkpoints")
Also, a few lines that start with ...
should be >>>
.
try: # >1.0 package structure | ||
from neptune.handler import Handler | ||
except ImportError: # <1.0 package structure | ||
from neptune.new.handler import Handler |
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.
Is all the code compatible with older versions? E.g. the use of append
instead of log
. If not, there is no point in having this check.
I think it's fine to tell users to install the latest version of neptune
(except if you know that users are reluctant to upgrade versions). E.g. when this class is initialized, there could be a version check and a helpful error message when the version is too low. WDYT?
from neptune.new.handler import Handler | ||
|
||
root_obj = self.run | ||
if isinstance(self.run, Handler): |
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.
Could you please add a comment here? What is the Handler
and why do we sometimes get a Handler
and sometimes a Run
?
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.
Thanks a lot for keeping the Neptune logger up to date and improving the docs.
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
No description provided.