René's URL Explorer Experiment


Title: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: · Issue #11 · eevee/camel · GitHub

Open Graph Title: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: · Issue #11 · eevee/camel

X Title: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: · Issue #11 · eevee/camel

Description: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: Hi there, All I am doing is this: @registry.loader('np_float64_mine', version=1) def _load_np_float64(obj, version, **kwargs): return ...

Open Graph Description: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: Hi there, All I am doing is this: @registry.loader('np_float64_mine', version=1) def _load_np_...

X Description: "Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: Hi there, All I am doing is this: @registry.loader('np_float64_mine', versio...

Opengraph URL: https://github.com/eevee/camel/issues/11

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Not Subscriptable\" Error in a very simple wrapper for numpy.float64 that simply converts it to float:","articleBody":"\"Not Subscriptable\" Error in a very simple wrapper for numpy.float64 that simply converts it to float:\r\n\r\n\r\nHi there, \r\n\r\nAll I am doing is this:\r\n\r\n   @registry.loader('np_float64_mine', version=1)\r\n    def _load_np_float64(obj, version, **kwargs):\r\n        return np.float64(obj)\r\n\r\n\r\nBut, I get this strange error. \r\n\r\n\r\nresolvers = self.yaml._implicit_resolvers.get(value[0],[])\r\nTypeError: 'float' object is not subscriptable\r\n\r\n\r\n\r\nThings work great for many more complex things, like np.ndarray, etc.\r\nBut, for some reason, it's trying to take the length of singletons(?) like np.float64.\r\n\r\nIf I am doing something stupid, I apologizie, and would appreciate if you'd point me in the right direction.\r\n\r\nBelow, for reference, is a full MRE of the error.\r\n\r\n----\r\n\r\n\r\n\r\nimport camel\r\n\r\ntry:\r\n    import numpy as np\r\n    _have_numpy = True\r\nexcept Exception:\r\n    have_numpy = False\r\n    warnings.warn(\"Numpy not found. Won't provide numpy-related methods.\")\r\n\r\nfrom camel import Camel, CamelRegistry\r\nregistry = CamelRegistry()\r\n\r\n\r\n\r\nif _have_numpy:\r\n   \r\n    ## THIS DUMP IS WHERE THE ERROR LIES. \r\n    @registry.dumper(np.float64, 'np_float64_mine', version=1)\r\n    def _dump_np_float64(obj, **kwargs):\r\n        return float(obj)\r\n\r\n    @registry.loader('np_float64_mine', version=1)\r\n    def _load_np_float64(obj, version, **kwargs):\r\n        return np.float64(obj)\r\n\r\n\r\n    ## everything else, works great, example, this - \r\n    @registry.dumper(np.ndarray, 'np_ndarray_mine', version=1)\r\n    def _dump_np_ndarray(obj, **kwargs):\r\n        return([ str(obj.dtype), obj.tolist() ] )\r\n\r\n    @registry.loader('np_ndarray_mine', version=1)\r\n    def _load_np_ndarray(obj, version, **kwargs):\r\n        (strdtype, obj)=obj\r\n        return np.asarray(obj, dtype=strdtype)\r\n\r\n\r\n\r\ndef _test(item):\r\n    print(\"ORIGINAL ITEM and its type:\")\r\n    print(item)\r\n    print(f\"{type(item)=}\")\r\n    dumped = dumps(item)\r\n    print(\"DUMPED ITEM:\")\r\n    print(dumped)\r\n    print(\"original item followed by LOAD OF DUMPED ITEM:\")\r\n    print(item)\r\n    print(loads(dumped))\r\n    print(\"=================================================================================================\")\r\n\r\n\r\ndef _tests():\r\n    _test(np.float64(345)\r\n\r\n\r\n","author":{"url":"https://github.com/deego","@type":"Person","name":"deego"},"datePublished":"2022-09-05T19:50:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/11/camel/issues/11"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5b95a1af-6405-68a0-e6eb-efef48227e60
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE420:A1401:16D719D:1D2339A:698BE506
html-safe-nonce542a2431524b3e9ba5e525fdc276b8f7605e643b9c531e0ebc861a4154e28c51
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDIwOkExNDAxOjE2RDcxOUQ6MUQyMzM5QTo2OThCRTUwNiIsInZpc2l0b3JfaWQiOiIxODQ5OTMyMDEzNDcwNzM3NjcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac530a009db3c3af4003a3bb78e3c4d24c0cf07a2cbc646c326f3f3d45b69bff67
hovercard-subject-tagissue:1362421642
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/eevee/camel/11/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3a44627ae4cca7e4ef921e3ad1eff3c662215474d8466a6d0ed2986a34c657f9/eevee/camel/issues/11
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3a44627ae4cca7e4ef921e3ad1eff3c662215474d8466a6d0ed2986a34c657f9/eevee/camel/issues/11
og:image:alt"Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float: Hi there, All I am doing is this: @registry.loader('np_float64_mine', version=1) def _load_np_...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedeego
hostnamegithub.com
expected-hostnamegithub.com
None640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4
turbo-cache-controlno-preview
go-importgithub.com/eevee/camel git https://github.com/eevee/camel.git
octolytics-dimension-user_id94112
octolytics-dimension-user_logineevee
octolytics-dimension-repository_id44578650
octolytics-dimension-repository_nwoeevee/camel
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id44578650
octolytics-dimension-repository_network_root_nwoeevee/camel
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/eevee/camel/issues/11#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Feevee%2Fcamel%2Fissues%2F11
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%2Feevee%2Fcamel%2Fissues%2F11
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=eevee%2Fcamel
Reloadhttps://patch-diff.githubusercontent.com/eevee/camel/issues/11
Reloadhttps://patch-diff.githubusercontent.com/eevee/camel/issues/11
Reloadhttps://patch-diff.githubusercontent.com/eevee/camel/issues/11
eevee https://patch-diff.githubusercontent.com/eevee
camelhttps://patch-diff.githubusercontent.com/eevee/camel
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Feevee%2Fcamel
Fork 7 https://patch-diff.githubusercontent.com/login?return_to=%2Feevee%2Fcamel
Star 157 https://patch-diff.githubusercontent.com/login?return_to=%2Feevee%2Fcamel
Code https://patch-diff.githubusercontent.com/eevee/camel
Issues 6 https://patch-diff.githubusercontent.com/eevee/camel/issues
Pull requests 1 https://patch-diff.githubusercontent.com/eevee/camel/pulls
Actions https://patch-diff.githubusercontent.com/eevee/camel/actions
Projects 0 https://patch-diff.githubusercontent.com/eevee/camel/projects
Wiki https://patch-diff.githubusercontent.com/eevee/camel/wiki
Security 0 https://patch-diff.githubusercontent.com/eevee/camel/security
Insights https://patch-diff.githubusercontent.com/eevee/camel/pulse
Code https://patch-diff.githubusercontent.com/eevee/camel
Issues https://patch-diff.githubusercontent.com/eevee/camel/issues
Pull requests https://patch-diff.githubusercontent.com/eevee/camel/pulls
Actions https://patch-diff.githubusercontent.com/eevee/camel/actions
Projects https://patch-diff.githubusercontent.com/eevee/camel/projects
Wiki https://patch-diff.githubusercontent.com/eevee/camel/wiki
Security https://patch-diff.githubusercontent.com/eevee/camel/security
Insights https://patch-diff.githubusercontent.com/eevee/camel/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/eevee/camel/issues/11
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/eevee/camel/issues/11
"Not Subscriptable" Error in a very simple wrapper for numpy.float64 that simply converts it to float:https://patch-diff.githubusercontent.com/eevee/camel/issues/11#top
https://github.com/deego
https://github.com/deego
deegohttps://github.com/deego
on Sep 5, 2022https://github.com/eevee/camel/issues/11#issue-1362421642
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.