-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
MAINT: Distinguish between private and public namespaces #601
Conversation
Hello @Smit-create! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-07-11 12:58:51 UTC |
Thanks @Smit-create this is good practice and a good idea. |
Many thanks for working on this @Smit-create . I'll leave the review to you @mmcky . Thanks in advance. |
thanks @Smit-create once we resolve the conflict I am happy for this to be merged. Thanks for putting it together. I think this is a good idea. Does this apply to any other modules? |
Yeah, this applies to every private module that should not be public. |
f8522ca
to
24b9c55
Compare
Perhaps we should update them all in the branch then and rename it to resolve #350 |
@Smit-create looks like the one failure on Is there any reason we can't migrate to just |
Yeah, we can move to |
It might be some platform+conda specific tolerance issue. Maybe we can slightly raise the tolerance value to make it pass. |
thanks for working on this @Smit-create. The diff makes it a bit tricky to track the changes -- for some reason the files aren't showing as modified (post a rename) but deleted and new files in place. Is this due to a force push? We will have to lean on the tests in that case. Can you ping me once the test suite is passing. Thanks. |
New files will have an underscore before their names, while the other files will be shown as modified.
Yeah, that's true. The diff is looking lengthy to review, but it all just follows the pattern which is followed in OP. |
Hmm. On other PR;s I have seen renamed files (with diffs). I'll have to try and find one, maybe it's because I tend to use |
87ff9d4
to
0961efd
Compare
I also have used the same. But the reason is, after renaming, I am creating a new file of the same name say:
|
Ah ha -- that make sense! Thanks @Smit-create |
@jstac I will review this PR against our lecture sites. But just wanted to tag you re: updates to interface in the The effect of this will be to make |
@Smit-create sorry it has taken me so long to loop around to this. Do you mind updating to the latest master and then I'll merge? |
e94f975
to
0ab7c73
Compare
@oyamad all public facing (importable) classes and functions should still all show up in the documentation. There may be some helper functions that won't be visible. Once this is updated I will take a closer look and see if we can do a test build of |
0ab7c73
to
cd0403b
Compare
I have rebased this branch on the lastest |
How will the development procedure go given this? |
@Smit-create This is not something caused by this PR, but would you fix these warnings (showing up during a documentation build) (change
|
Suppose someone needs to write a new routine The current PR creates a new file |
Thanks, fixed that. Docs build log
% make html
python qe_apidoc.py
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v5.3.0
OMP: Info #273: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
making output directory... done
WARNING: html_static_path entry '_static' does not exist
WARNING: Support for emitting HTML 4 output is deprecated and will be removed in Sphinx 7. ("html4_writer=True detected in configuration options)
loading intersphinx inventory from http://docs.python.org/objects.inv...
intersphinx inventory has moved: http://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
[autosummary] generating autosummary for: game_theory.rst, game_theory/brd.rst, game_theory/fictplay.rst, game_theory/game_generators/bimatrix_generators.rst, game_theory/lemke_howson.rst, game_theory/localint.rst, game_theory/logitdyn.rst, game_theory/mclennan_tourky.rst, game_theory/normal_form_game.rst, game_theory/pure_nash.rst, ..., tools/rank_nullspace.rst, tools/robustlq.rst, util.rst, util/array.rst, util/combinatorics.rst, util/common_messages.rst, util/notebooks.rst, util/numba.rst, util/random.rst, util/timing.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 65 source files that are out of date
updating environment: [new config] 65 added, 0 changed, 0 removed
reading sources... [100%] util/timing
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] util/timing
generating indices... genindex py-modindex done
highlighting module code... [ 43%] quantecon.game_theory.game_generators.bimatrihighlighting module code... [100%] quantecon.util.timing
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 2 warnings.
The HTML pages are in build/html.
Build finished. The HTML pages are in build/html. |
# Imports that should be deprecated with markov package | ||
from .markov import mc_compute_stationary, mc_sample_path | ||
|
||
# Imports that are deprecated and will be removed in further versions |
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.
@Smit-create do we have any infrastructure that issues a Warning
for users that do import these that advises them to move towards the new import path (in version 0.7.0
) etc.?
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 don't want to hold up the release but if we don't then perhaps we can add this to help with migration given these are still available at the top level.
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 works in the following way:
>>> from quantecon.ecdf import ECDF # works but throws a warning
<stdin>:1: DeprecationWarning: Please use `ECDF` from the `quantecon` namespace, the `quantecon.ecdf` namespace is deprecated. You can use the following instead:
`from quantecon import ECDF`.
>>> from quantecon import ECDF
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 @Smit-create I thought that was the case. Once we identify a deprecation point I might update these in a future release to let users know when that will happen.
Just saw this @oyamad -- looping round re: contribution / style guide is a great idea. I'll open an issue to track this. #665 |
@oyamad are you happy for me to merge this to
to check that the main branch is working across our projects before cutting a release (likely tomorrow or Monday). It's a high volume change -- so I want to make sure you're OK with this :-). |
thanks @Smit-create for all your work on this. It's been a long time coming but I will merge this now and do some final testing of the release candidate on |
…ntEcon#601)" This reverts commit b0ac7e8.
…ntEcon#601)" This reverts commit b0ac7e8.
…ntEcon#601)" This reverts commit b0ac7e8.
Revert "MAINT: Distinguish between private and public namespaces (#601)"
Related to #350
I am trying to work on #350 by using private and public namespace changes. Since
ecdf.py
is not meant for public namespace i.e we want users to usefrom quantecon import ECDF
instead offrom quantecon.ecdf import ECDF
, we can do the following to resolve this:ecdf.py
to_ecdf.py
usinggit mv
(This preserves the commit history ofecdf.py
and transfers it to_ecdf.py
)ecdf.py
and add warnings (This is required at the current stage to avoid breaking the code and can be removed safely in future versions)The current PR works in the following way:
We can remove the
ecdf.py
file in future versions and then we will just have_ecdf.py
as a private namespacecc @mmcky @jstac