Closed
Conversation
1. Add `bin/get_size.py` so that `python bin/get_size.py plotly build`
reports the number of files and total size in bytes of the `plotly`
directory (where generated code is put) and the `build` directory
that is populated by `python setup.py build`.
1. Modify `codegen/__init__.py` and `./setup.py` so that
`python setup.py --reformat=false` disables reformatting.
1. Alias name of base validator during import in `codegen/validators.py`.
1. Remove the long list of CSS colors from help strings for color
properties.
1. Assign an empty string to the `data_docs` field of generated validators.
1. Introduce a method `_init_provided` for `BaseFigure` and
`BasePlotlyType` that calls a helper function `_initialize_provided`
to replace repetitions of:
```
_v = arg.pop("something", None)
_v = something if something is not None else _v
if _v is not None:
self["something"] = _v
```
Original size of plotly/**/*.py: 50365842 bytes
Current size of plotly/**/*.py: 38256842 bytes
Change: -26%
Removing the check for Python < 3.7 using `sys.version_info` and as a backup checking `typing.TYPE_CHECKING`; this saves us a little space and also cleans up the code. Proposing this as an enhancement beyond what's in the `codegen2` branch / PR #4978.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: drop use of sys.version_info and TYPE_CHECKING
Removing the check for Python < 3.7 using
sys.version_infoand as abackup checking
typing.TYPE_CHECKING; this saves us a little spaceand also cleans up the code.
Proposing this as an enhancement beyond what's in the
codegen2branch / PR #4978.