René's URL Explorer Experiment


Title: NEW FEATURE: Export projects as python scripts · Issue #4 · psyplot/psyplot · GitHub

Open Graph Title: NEW FEATURE: Export projects as python scripts · Issue #4 · psyplot/psyplot

X Title: NEW FEATURE: Export projects as python scripts · Issue #4 · psyplot/psyplot

Description: Summary psyplot projects should be exportable directly to python scripts, not only as pickle files. Reason When trying to reproduce a plot created through the GUI, it would be helpful to have a python script to generate it, such that it ...

Open Graph Description: Summary psyplot projects should be exportable directly to python scripts, not only as pickle files. Reason When trying to reproduce a plot created through the GUI, it would be helpful to have a pyt...

X Description: Summary psyplot projects should be exportable directly to python scripts, not only as pickle files. Reason When trying to reproduce a plot created through the GUI, it would be helpful to have a pyt...

Opengraph URL: https://github.com/psyplot/psyplot/issues/4

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NEW FEATURE: Export projects as python scripts","articleBody":"### Summary\r\npsyplot projects should be exportable directly to python scripts, not only as\r\npickle files.\r\n\r\n### Reason\r\nWhen trying to reproduce a plot created through the GUI, it would be helpful\r\nto have a python script to generate it, such that it can be copy-pasted to\r\nanother python script.\r\n\r\n### Detailed explanation\r\nOne strength of psyplot is the short and easy syntax for formatoptions and\r\nthe structured data handling. And since anyway most of the formatoption \r\ncome in standard python objects  like lists, strings, etc. it would be \r\nstraight-forward with python `repr` function to reproduce them in a script.\r\n\r\n#### Challenges\r\n1. Only datasets that have been stored to disc can be opened in the\r\n    script\r\n2. The matplotlib axes setup has to be reproduced\r\n3. Some formatoptions do require more complex data structures, such \r\n    as colormaps or numpy arrays\r\n\r\n#### Proposed methodology to generate the script\r\n\r\n1. open the netCDF dataset from disk (if it is stored on the disk, otherwise leaf that\r\n   empty such that the user can fill this in\r\n\r\n   ```python\r\n   ds1 = xr.open_dataset('nc-file1.nc')\r\n   ds2 = xr.open_dataset('nc-file2.nc')\r\n   ds3 =    # dataset has not been stored on the disc\r\n   ```\r\n   The number ``ds\u003cnumber\u003e`` should be determined by the \r\n   `psyplot.data.DatasetAccessor.num` attribute\r\n2. We should not use the `psyplot.project.plot` API directly, since the plot methods\r\n    can have diverse calling signatures. So we extract the data and create the plot for \r\n    each array in the project from scratch. Therefore, for each data object in the project,\r\n    export a script to\r\n\r\n    1. reproduce the DataArray (or InteractiveList) from the datasets `ds1, ds2, ...`\r\n    2.  Create the matplotlib axes that is visualized (if there is a plotter)\r\n    3. open the plotter class from psyplot (if there is a plotter)\r\n\r\n3. Concatenate all the extracted data arrays/lists into one project\r\n\r\n#### Proposed API additions:\r\n\r\n1. A new method `psyplot.data.ArrayList.to_script()` to top-level API method that \r\n   generates the python script to reproduce the list/project. It should create the part\r\n   to open the datasets and call the `to_script` method of the contents\r\n2. A new abstract method `psyplot.script.InteractiveBase.to_script()` that \r\n    generates the string to generate this data structure. If the object has a \r\n    plotter, it should call the `to_script` method of the plotter\r\n3. A new abstract method `psyplot.plotter.Plotter.to_script()` method, that\r\n\r\n   1. Creates the matplotlib axes\r\n   2. Creates the plotter by first checking the `prepare_string` methods of the\r\n       formatoptions and then the `as_string` method\r\n4. A new `psyplot.plotter.Formatoption.prepare_string` method, that returns\r\n    a string with necssary preparations for the formatoption. In case of a \r\n    colormap instance, for example, this could be the example how the colormap is\r\n    created. So by default, this should be an empty string\r\n5. A new `psyplot.plotter.Formatoption.as_string` method, that is called after\r\n    the `prepare_string` method and sets the value for the formatoption in the \r\n    `Plotter(...)`  initialization. By default, this should just be ``repr(self.value)``\r\n\r\n### Examples\r\nParaview for example has this functionality with [Tools-\u003eStart Trace](https://www.paraview.org/python/)\r\n","author":{"url":"https://github.com/Chilipp","@type":"Person","name":"Chilipp"},"datePublished":"2018-04-11T15:37:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4/psyplot/issues/4"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:356d035d-eb57-587a-0e89-1aa319999959
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B98:133EFF:46EDA9C:615A92E:698CDDFC
html-safe-nonce66b03140fd837019c90c196fc2126322abef185550ad3d31366118ff52875cf1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk4OjEzM0VGRjo0NkVEQTlDOjYxNUE5MkU6Njk4Q0RERkMiLCJ2aXNpdG9yX2lkIjoiNjM3NjY2Mzg3Mzg5MzczOTQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9a6f39fe29fbc517d8bae5277f41dcf10bf0901dd1c6981e2c1ff6a01ae7e8b6
hovercard-subject-tagissue:313378779
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/psyplot/psyplot/4/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2e04c4d0c0eb709d1c0f4ceab2ee075e92af7a8a27af049ae2bc11ab336cddfc/psyplot/psyplot/issues/4
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2e04c4d0c0eb709d1c0f4ceab2ee075e92af7a8a27af049ae2bc11ab336cddfc/psyplot/psyplot/issues/4
og:image:altSummary psyplot projects should be exportable directly to python scripts, not only as pickle files. Reason When trying to reproduce a plot created through the GUI, it would be helpful to have a pyt...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameChilipp
hostnamegithub.com
expected-hostnamegithub.com
None640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4
turbo-cache-controlno-preview
go-importgithub.com/psyplot/psyplot git https://github.com/psyplot/psyplot.git
octolytics-dimension-user_id60222268
octolytics-dimension-user_loginpsyplot
octolytics-dimension-repository_id87944102
octolytics-dimension-repository_nwopsyplot/psyplot
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id87944102
octolytics-dimension-repository_network_root_nwopsyplot/psyplot
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3d444f0a47beeeac94cddbb51c91ab408befe8d4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/psyplot/psyplot/issues/4#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpsyplot%2Fpsyplot%2Fissues%2F4
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpsyplot%2Fpsyplot%2Fissues%2F4
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=psyplot%2Fpsyplot
Reloadhttps://patch-diff.githubusercontent.com/psyplot/psyplot/issues/4
Reloadhttps://patch-diff.githubusercontent.com/psyplot/psyplot/issues/4
Reloadhttps://patch-diff.githubusercontent.com/psyplot/psyplot/issues/4
psyplot https://patch-diff.githubusercontent.com/psyplot
psyplothttps://patch-diff.githubusercontent.com/psyplot/psyplot
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpsyplot%2Fpsyplot
Fork 15 https://patch-diff.githubusercontent.com/login?return_to=%2Fpsyplot%2Fpsyplot
Star 79 https://patch-diff.githubusercontent.com/login?return_to=%2Fpsyplot%2Fpsyplot
Code https://patch-diff.githubusercontent.com/psyplot/psyplot
Issues 8 https://patch-diff.githubusercontent.com/psyplot/psyplot/issues
Pull requests 0 https://patch-diff.githubusercontent.com/psyplot/psyplot/pulls
Actions https://patch-diff.githubusercontent.com/psyplot/psyplot/actions
Projects 0 https://patch-diff.githubusercontent.com/psyplot/psyplot/projects
Security 0 https://patch-diff.githubusercontent.com/psyplot/psyplot/security
Insights https://patch-diff.githubusercontent.com/psyplot/psyplot/pulse
Code https://patch-diff.githubusercontent.com/psyplot/psyplot
Issues https://patch-diff.githubusercontent.com/psyplot/psyplot/issues
Pull requests https://patch-diff.githubusercontent.com/psyplot/psyplot/pulls
Actions https://patch-diff.githubusercontent.com/psyplot/psyplot/actions
Projects https://patch-diff.githubusercontent.com/psyplot/psyplot/projects
Security https://patch-diff.githubusercontent.com/psyplot/psyplot/security
Insights https://patch-diff.githubusercontent.com/psyplot/psyplot/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/psyplot/psyplot/issues/4
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/psyplot/psyplot/issues/4
NEW FEATURE: Export projects as python scriptshttps://patch-diff.githubusercontent.com/psyplot/psyplot/issues/4#top
new featureRequest for adding a new feature to the packagehttps://github.com/psyplot/psyplot/issues?q=state%3Aopen%20label%3A%22new%20feature%22
https://github.com/Chilipp
https://github.com/Chilipp
Chilipphttps://github.com/Chilipp
on Apr 11, 2018https://github.com/psyplot/psyplot/issues/4#issue-313378779
Tools->Start Tracehttps://www.paraview.org/python/
new featureRequest for adding a new feature to the packagehttps://github.com/psyplot/psyplot/issues?q=state%3Aopen%20label%3A%22new%20feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.