question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC Definition of public API

See original GitHub issue

In several PRs (e.g. https://github.com/scikit-learn/scikit-learn/issues/11182 https://github.com/scikit-learn/scikit-learn/pull/12916) the question arises whether we need to deprecate some object before it can be removed or changed. This goes back to defining what is public API in scikit-learn.

The lest controversial definition is that,

  • import paths with that include a module with a leading _ are private
  • other modules are public.

However, you could do, for instance,

from sklearn.cluster.dbscan_ import NearestNeighbors

Does it mean that we are supposed to preserve backward compatibility on sklearn.cluster.dbscan_.NearestNeighbors in terms of import path? How about sklearn.preprocessing.data.sparse (scipy.sparse)?

I guess not, meaning that just because we have an import path without an underscore does not mean that it is part of the public API. At the very least it also needs to be documented or used in examples.

If we take this definition,

This would mean that we can e.g. remove sklearn.externals.six in https://github.com/scikit-learn/scikit-learn/pull/12916 without a deprecation warning (but possibly with a what’s new entry). I have a hard time seeing a user reasonably complaining that we didn’t go through a deprecation cycle there.

This would also help resolving the “public vs private utils” discussion in https://github.com/scikit-learn/scikit-learn/issues/6616

WDYT, do you have other ideas of how we should define what is public API in scikit-learn?

cc @scikit-learn/core-devs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasHugcommented, Sep 16, 2019

I agree that the conflicts aren’t as trivial as I thought.

The solution I could come up with so far is that the PR authors must create a commit where they rename file.py into _file.py and create a new empty file.py (or better check it out from master).

Then the merge with master is easy.

But the process isn’t necessarily obvious yeah

1reaction
jnothmancommented, Sep 16, 2019

Or maybe what we need is a tool to help solve such merge conflicts. It’s still the same patch, it just needs to be applied with respect to a different path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 2614 - An API for Service Location - IETF Datatracker
An API for Service Location (RFC 2614, June 1999. ... Each property definition corresponds to a particular configurable SLP, network, or other parameter...
Read more >
Request for Comments - Wikipedia
A Request for Comments (RFC) is a publication in a series from the principal technical development and standards-setting bodies for the Internet, ...
Read more >
An introduction to RFC 7807 | Representing Problem Details ...
RFC 7807 has a simple extension model: APIs are free to add any other members to the problem details object, so all members...
Read more >
Standards.REST
HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API. HTTP Immutable Responses, RFC...
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found