Skip to content

Docs: Clarify statement about the API#66

Merged
tpapp merged 2 commits into
masterfrom
unknown repository
Apr 6, 2020
Merged

Docs: Clarify statement about the API#66
tpapp merged 2 commits into
masterfrom
unknown repository

Conversation

@DilumAluthge
Copy link
Copy Markdown
Contributor

If I understand correctly, if I have an object of type TransformedLogDensity, then the official way of getting the transformation or log_density_function fields is by doing ℓ.transformation or ℓ.log_density_function, respectively.

This pull request edits the docstring for TransformedLogDensity to emphasize that this is part of the stable public API and will not change in a non-breaking release.

@tpapp
Copy link
Copy Markdown
Owner

tpapp commented Apr 2, 2020

I thought it was implied that whatever that is part of the API cannot change in a breaking way without it being a non-breaking change.

I am not sure I understand the distinction between "stable API" and "API", can you please clarify?

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2020

Codecov Report

Merging #66 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #66   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files           5        5           
  Lines          66       66           
=======================================
  Hits           64       64           
  Misses          2        2
Impacted Files Coverage Δ
src/LogDensityProblems.jl 96.87% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b9dd0c...d26ba0c. Read the comment docs.

@DilumAluthge
Copy link
Copy Markdown
Contributor Author

I've changed "stable public API" to "public API".

I usually think of a package's API as being divided into two parts:

  1. The public API. This is stable and follows semantic versioning, i.e. breaking changes to the public API can only be made when you bump the major version number.
  2. The private API, also known as the internal API. You are allowed to make breaking changes to the private API in minor version bumps.

Generally, I assume that names that are exported are part of the public API, while names that are not exported are part of the private/internal API.

Also, as a general rule of thumb, I assume that field names of a struct are part of the private/internal API.

But in this case, it looks like the .transformation and .log_density_function are part of the public API, not the private/internal API. So I wanted to make that distinction.

I guess to me, "API" means it could either be the public API or the private/internal API.

@tpapp
Copy link
Copy Markdown
Owner

tpapp commented Apr 6, 2020

Thanks for clarifying this. I agree with everything you wrote above, except that for me an unqualified "API" means "public API".

@tpapp tpapp merged commit e732372 into tpapp:master Apr 6, 2020
@DilumAluthge DilumAluthge deleted the dpa/document-stable-public-api branch April 6, 2020 05:42
@tpapp tpapp mentioned this pull request Sep 5, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants