Wikifunctions:状态更新/2025-01-29
| ◀ | ▶ |
伴随2000个功能进入新的一年:统计时间
几周前,我们的功能突破了2000个!我们将遵循“莉迪亚规则”(以维基数据项目组合负责人莉迪亚-品特舍尔的名字命名):不应将随机通过里程碑作为无背景庆祝的理由,而应将其作为研究统计数据、总结我们的现状和成就的机会。
截至本文撰写之时(2025 年1月 29日,星期三),我们共有2096个函数。但其中有189个没有连接到实现,因此无法使用,有380个没有连接到测试,因此文档不足,质量不明。如果我们只考虑至少有一个连接测试和实现的函数,那么函数的数量就会下降到1662个--这仍然是我们现有函数的五分之四,但可能会更好。我们现在有一个特殊页面可以帮助查找没有测试的函数。我们有大约3473个工具和 6179 个测试。
由于我们的搜索能力还不是很强,手工整理的函数目录可能是查找函数的主要入口。它总共列出了1193个函数(尽管有些函数可能不止列出一次)。它有17个顶级组:逻辑(8)、布尔(30)、(10)、字符串(164)、科学(13)、自然语言(328,见下文)、(72)、字符(12)、(354)、日期(92)、维基(30)、(8)、类型(11)、函数(10)、编程(1)和颜色(18)。
要细分自然语言功能,则有13个全球自然语言功能,然后我们有以下自然语言的功能:阿拉伯语(5)、孟加拉语(23)、巴斯克语(21)、布拉维语(11)、布列塔尼语(69)、克罗地亚语(44)、达格巴尼语(3)、荷兰语(1)、英语(21)、西班牙语(16)、芬兰语(1)、法语(10)、德语(15)、乌尔都语(4)、伊格博语(14)、日语(3)、波斯语(6)、韩语(3)、库尔德语(10)、马拉雅拉姆语(3)、摩洛哥阿拉伯语(3)、波兰语(1)、旁遮普语(3)、罗辛亚语(8)、俄语(1)、苏格兰盖尔语(1)、塞尔维亚语(1)、信德语(8)、西班牙语(1)、瑞典语(1)、土耳其语(2)和乌克兰语(2)。
到目前为止, Wikifunctions 已被编辑了近50,000次。去年,我们统计的页面访问量超过4300万,但由于爬虫在为人工智能收集训练数据时没有正确表明自己的身份以及其他问题,这个数字可能被夸大了。如果这个数字属实,那么它将是去年的10倍。目前,我们每月能看到约3000次功能调用,其中大部分来自功能页面,另有400次通过外部 API 调用。有50多个国家的代表担任编辑,有200多个国家和地区的人访问过维基功能,换句话说,几乎所有国家的人都访问过维基功能。年初,我们有大约20名活跃贡献者,后来增加到大约100名活跃贡献者。
其中一些数字让我们非常高兴--功能的健康成长、实现连接和功能测试的比例高、为维基功能做出贡献和访问维基功能的国家数大。而有些数字,我们很难真正理解:页面浏览量似乎有问题。最后,我们希望在未来的一年中看到某些功能的显著增长,特别是功能调用的数量和积极贡献者的数量。我们希望,将维基功能整合到维基媒体和其他维基媒体项目中,将激发人们的兴趣和热情,从而带来更强劲的数字。
2月3日的下一次志愿者角活动
下周星期一,2025年2月3日,世界协调时18:30,我们将举行每月一次的志愿者论坛。除非您有很多问题,否则我们将按照以往的议程,介绍即将到来的计划和近期活动的最新情况,为您的提问提供充足的时间和空间,并共同建立一个功能区。期待周一在线与您见面!
Recent Changes in the software
A very short list this week, as a lot of our focus has been on delivering the bigger pieces of work for the Quarter.
We've fixed the "report" widget to not run the test suite on brand-new Implementations or Tests, as there's no content to test yet (T375242). Thank you to User:GrounderUK for the suggestion.
We've prepared a database schema change that, once applied in production, will allow filtering searches for Functions to limit results to Functions that can be embedded in Wikipedia articles (T383561). More coming soon.
We, along with all Wikimedia-deployed code, are now using the latest version of the Codex UX library, v1.20.0, as of this week. We believe that there should be no user-visible changes on Wikifunctions, so please comment on the Project chat or file a Phabricator task if you spot an issue.
News in Types: Read and display functions for Rational and Floating point numbers
A few weeks ago we introduced the Rational number and Floating point number types. The community has been working on read and display functions since then, and now we have a working set. Both have been introduced, making it much easier to use functions with these types. Thanks to everyone who has been working on these!
Function of the Week: Python converter to float64
The Function of the Week is a column written by the community. Planning the column and submissions can be made here. This week’s entry was written by 99of9 with edits by Feeglgeef.
本周的“本周函数”不是函数!本周我们将讨论 Python float64 转换器。这是一个代码中的类型转换器,它们正常工作时对函数编写者几乎不可见,但它们的准确性对大多数新类型的成功发布至关重要。当您的代码执行的返回值需要转换为 Wikifunctions 用于返回对象类型的内部表示型时这些转换器就会被调用。
This particular converter is for values returned by Python implementations which implement a function which returns a float64, our type for representing 64-bit floating point numbers, which within python are typed "float". It was written by Denny, as connected converters are currently only editable by staff. This is one of the most complicated type conversions we have to date. The 64 bits in the native float are actually in three groups which are overloaded to take on different meanings in special contexts. These need to be converted to four keys for a float64, three with broadly parallel meaning, and one to enumerate the value in special contexts.
代码转换器不像函数那样有多种实现方式。它们只是用它们正在转换的语言返回代表一个 ZObject 结构的JSON。这个函数使用数学库函数检查每个可能的特殊值(NaN、带符号的无穷大、带符号的零)。如果是特殊值,则设置特殊值键,由于其他键现在无关紧要,因此它们将返回默认值0。如果输入的不是特殊值,则测试符号,并通过math.frexp将规模扩展到它的尾数和指数。然后将尾数从[0.5,1) 的范围移至[0,0.5),因为就像IEEE 754 二进制表示法一样,我们的有效数有一隐藏的前导字节,等同于总是将 0.5 加回到该值。返回的指数会减1以解释[1,2)中的正常二进制精度范围。对于 float64 的有效数将转换为0至252-1范围内的自然数。重要的是这些操作都不会产生舍入误差。
No tests are directly attached to Type converters, but we can test them indirectly. If a python implementation of any function that returns floats is failing valid tests, it is possible that this is due to the converter. This week a subtle bug was corrected, because a test returning the special value of -0 was failing in the python implementation of Rational number to float. That function also has tests for some of the other special values, and numerous floating-point edge cases. Depending on our intent for the ignored keys of special values, we can also use tests with stricter implementations testing cases like equality of +infinity with different exponent keys.
将数值转换为 Wikifunctions float64 的键值,是我们之中的一些人目前设计 float64 函数测试时需要完成的任务。它对人类的难度比对转换器更甚!为了减轻这项工作的难度,我们预计将很快为 float64 添加一个浮点读取器函数,该函数将从输入的任何字符串中读取数字(就像整数已经有的一样)。
供讨论的问题:
- 特殊值在返回时,它们的其他键值(通常不考虑)是否应与IEEE 754 二进制表示法中的符号、尾数和指数值相匹配?
每周新鲜功能
以下列表包含上周以来创建的新函数,已经实现连接和(大部分)通过测试。
- string includes "na" or "nf"(Z21987)
- string includes / or %(Z21980)
- display Rational number(Z21971)
- remove arabic harakat (Z21961)
- display float64(Z21956)
- Clamp(Z21951)
- float64 as string (multilingual default)(Z21949)
- float as string (Python conventions)(Z21939)
- rational number reader(Z21930)
- read float64(Z21925)
- complex conjugate (integer list)(Z21917)
- Gregorian to Holocene year(Z21913)
- get cross product(Z21903)
- compound interest amount(Z21898)
- acceleration (float64)(Z21893)
- Add indefinite article to noun, Spanish(Z21886)
- is narcissistic number(Z21868)
- "[name], a [role] from [country]," in English(Z21862)
- mean arterial pressure(Z21856)
- mode of list (integer)(Z21851)
- Quadratic equation solver (float64)(Z21848)
- date string (English) to ISO 8601(Z21842)
- rational from finite simple continued fraction(Z21835)
- generate untyped list of length(Z21821)
- scientific (e) notation String as Rational number(Z21814)
- rational as plain decimal string with sig figures(Z21796)
- "[gender] is a [country] [professional]", Spanish(Z21791)
- decimal string from Rational number(Z21787)
- negate (float64)(Z21775)
- apply rational number function to float64(Z21770)
- English simple copular sentence(Z21765)
- read special value floating point from string(Z21750)
- an or a? (English)(Z21739)
- English indef noun phrase(Z21734)
- is non-negative rational number(Z21721)
- is negative rational number(Z21714)
- is positive rational number(Z21702)
- absolute value of rational number(Z21692)
- unformat decimal string(Z21682)