Skip to content

Commit bb726ea

Browse files
authored
Detect PyMoDAQ dependencies (#241)
Recognise declared `pymodaq` dependencies as PyMoDAQ, the scientific instrument acquisition and control software. Include its research taxonomy in the report and update the generated tool list.
1 parent 4aa3d21 commit bb726ea

5 files changed

Lines changed: 55 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Language ecosystems and development tools across multiple categories.
324324

325325
**Native Ext:** Maturin, Neon, Rustler, cffi, meson-python, mkmf, nanobind, napi-rs, node-gyp, phpize, pybind11, rb-sys, scikit-build-core, setuptools Extension, setuptools-rust.
326326

327-
**Library:** Akka, Akka HTTP, Apache Flink, Apache Pekko, Apache Pekko HTTP, Apache Spark, Authlib, Busboy, CarrierWave, Cats Effect, Celery, Chi, Circe, Devise, Doobie, EJS, Fabric, Faraday, Finagle, Finatra, Formidable, FreeMarker, Gson, Guzzle, HTTParty, Haml, Handlebars, JDOM, Jackson, Jinja2, Kafka Streams, Laravel Sanctum, Liquid, Magnus, Mako, Monix, Multer, Mustache, Newtonsoft.Json, NextAuth.js, Nokogiri, Nunjucks, OkHttp, OmniAuth, Ox, PHP LDAP, Passport, Play, Pug, PyCryptodome, PyJWT, PyYAML, Quill, React, RestClient, Resty, ShellJS, Shrine, Slick, Slim, SnakeYAML, SolidJS, Spring Security, Tailwind CSS, Tapir, Tera, Thymeleaf, Twig, UnoCSS, Velocity, XStream, ZIO, ZIO HTTP, aiohttp, axios, bcrypt, bcrypt-ruby, cross-spawn, crypto-js, cryptography, defusedxml, dom4j, execa, fast-xml-parser, fs2, golang-jwt, got, http4s, httpx, js-yaml, jsonwebtoken, ldap3, ldapjs, lxml, net-ldap, node-fetch, python-jose, python-multipart, requests, reqwest, ruamel.yaml, ruby-jwt, sh, undici, urllib3, xml2js.
327+
**Library:** Akka, Akka HTTP, Apache Flink, Apache Pekko, Apache Pekko HTTP, Apache Spark, Authlib, Busboy, CarrierWave, Cats Effect, Celery, Chi, Circe, Devise, Doobie, EJS, Fabric, Faraday, Finagle, Finatra, Formidable, FreeMarker, Gson, Guzzle, HTTParty, Haml, Handlebars, JDOM, Jackson, Jinja2, Kafka Streams, Laravel Sanctum, Liquid, Magnus, Mako, Monix, Multer, Mustache, Newtonsoft.Json, NextAuth.js, Nokogiri, Nunjucks, OkHttp, OmniAuth, Ox, PHP LDAP, Passport, Play, Pug, PyCryptodome, PyJWT, PyMoDAQ, PyYAML, Quill, React, RestClient, Resty, ShellJS, Shrine, Slick, Slim, SnakeYAML, SolidJS, Spring Security, Tailwind CSS, Tapir, Tera, Thymeleaf, Twig, UnoCSS, Velocity, XStream, ZIO, ZIO HTTP, aiohttp, axios, bcrypt, bcrypt-ruby, cross-spawn, crypto-js, cryptography, defusedxml, dom4j, execa, fast-xml-parser, fs2, golang-jwt, got, http4s, httpx, js-yaml, jsonwebtoken, ldap3, ldapjs, lxml, net-ldap, node-fetch, python-jose, python-multipart, requests, reqwest, ruamel.yaml, ruby-jwt, sh, undici, urllib3, xml2js.
328328

329329
**Codegen:** Buf, GraphQL Code Generator, OpenAPI, Protobuf, Thrift, Wire, ent, gRPC, mockgen, sqlc.
330330

‎detect/pymodaq_test.go‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package detect
2+
3+
import "testing"
4+
5+
func TestPyMoDAQProject(t *testing.T) {
6+
assertToolDetected(t, runOn(t, "../testdata/pymodaq-project"), "library", "PyMoDAQ")
7+
}
8+
9+
func TestPyMoDAQDependencySignals(t *testing.T) {
10+
for _, tt := range []struct{ path, content string }{
11+
{"pyproject.toml", "[project]\nname = 'spectrometer'\ndependencies = ['pymodaq>=4']\n"},
12+
{"requirements.txt", "pymodaq\n"},
13+
} {
14+
t.Run(tt.path, func(t *testing.T) {
15+
dir := t.TempDir()
16+
writeFile(t, dir, tt.path, tt.content)
17+
assertToolDetected(t, runOn(t, dir), "library", "PyMoDAQ")
18+
})
19+
}
20+
}
21+
22+
func TestPyMoDAQRequiresDeclaredDependency(t *testing.T) {
23+
for _, tt := range []struct{ path, content string }{
24+
{"requirements.txt", "pymodaq-plugins\n"},
25+
{"README.md", "Install pymodaq to control the spectrometer.\n"},
26+
{"instrument.py", "from pymodaq import utils\n"},
27+
{"fixtures/requirements.txt", "pymodaq\n"},
28+
} {
29+
t.Run(tt.path, func(t *testing.T) {
30+
dir := t.TempDir()
31+
writeFile(t, dir, tt.path, tt.content)
32+
assertToolNotDetected(t, runOn(t, dir), "library", "PyMoDAQ")
33+
})
34+
}
35+
}

‎kb/kb_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ func TestResearchToolTaxonomy(t *testing.T) {
380380
"targets": {"role:build-tool", "role:orchestrator", "function:workflow-orchestration", "domain:data-science", "domain:research", "domain:scientific-computing", "audience:data-scientist", "audience:researcher"},
381381
"R Markdown": {"function:documentation", "function:literate-programming", "function:report-generation"},
382382
"knitr": {"function:documentation", "function:literate-programming", "function:report-generation"},
383+
"PyMoDAQ": {"role:application", "domain:research", "domain:scientific-computing"},
383384
}
384385
for name, tags := range want {
385386
tool := base.ByName[name]

‎knowledge/python/pymodaq.toml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[tool]
2+
name = "PyMoDAQ"
3+
category = "library"
4+
homepage = "https://pymodaq.cnrs.fr/"
5+
docs = "https://pymodaq.cnrs.fr/en/latest/"
6+
repo = "https://github.com/PyMoDAQ/PyMoDAQ"
7+
description = "Modular data acquisition and control for scientific instruments"
8+
9+
[detect]
10+
dependencies = ["pymodaq"]
11+
ecosystems = ["python"]
12+
13+
[taxonomy]
14+
role = ["application"]
15+
domain = ["research", "scientific-computing"]

‎testdata/pymodaq-project/setup.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup(name="spectrometer", install_requires=["pymodaq"])

0 commit comments

Comments
 (0)