@ca-plant-list/ca-plant-list 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/inattaxonphotos.csv +89 -4
- package/data/synonyms.csv +7 -0
- package/data/taxa.csv +24 -22
- package/data/text/Asclepias-californica.md +1 -0
- package/data/text/Asclepias-cordifolia.md +1 -0
- package/data/text/Asclepias-eriocarpa.md +1 -0
- package/data/text/Asclepias-speciosa.md +1 -0
- package/data/text/Calystegia-malacophylla-subsp-pedicellata.md +1 -0
- package/data/text/Calystegia-purpurata-subsp-purpurata.md +1 -0
- package/data/text/Calystegia-sepium-subsp-limnophila.md +1 -0
- package/data/text/Calystegia-silvatica-subsp-disjuncta.md +1 -0
- package/data/text/Ribes-aureum-var-gracillimum.md +1 -0
- package/data/text/Ribes-californicum-var-californicum.md +1 -0
- package/data/text/Ribes-divaricatum-var-pubiflorum.md +1 -0
- package/data/text/Ribes-malvaceum-var-malvaceum.md +1 -0
- package/data/text/Ribes-menziesii-var-menziesii.md +1 -0
- package/data/text/Ribes-quercetorum.md +1 -0
- package/data/text/Ribes-sanguineum-var-glutinosum.md +1 -0
- package/data/text/Ribes-speciosum.md +1 -0
- package/data/text/Toxicoscordion-fremontii.md +1 -1
- package/data/text/Toxicoscordion-paniculatum.md +1 -1
- package/data/text/Toxicoscordion-venenosum-var-venenosum.md +1 -1
- package/data/text/Viola-purpurea-subsp-purpurea.md +1 -0
- package/data/text/Viola-purpurea-subsp-quercetorum.md +1 -1
- package/lib/csv.js +27 -5
- package/lib/taxa.js +23 -22
- package/lib/util.js +4 -3
- package/lib/utils/inat-tools.js +90 -0
- package/package.json +2 -2
- package/scripts/cpl-photos.js +179 -0
- package/tmp/config.json +21 -0
- package/tmp/exceptions.json +93 -0
- package/tmp/families.json +790 -0
- package/tmp/genera.json +5566 -0
- package/tmp/inattaxonphotos.csv +6059 -0
- package/tmp/synonyms.csv +2141 -0
- package/tmp/taxa_include.csv +19 -0
- package/types/classes.d.ts +7 -0
- package/scripts/photos.js +0 -68
@@ -0,0 +1,19 @@
|
|
1
|
+
taxon_name,status
|
2
|
+
Abutilon theophrasti
|
3
|
+
Acacia baileyana
|
4
|
+
Acacia dealbata
|
5
|
+
Acacia longifolia
|
6
|
+
Acacia melanoxylon
|
7
|
+
Acacia paradoxa
|
8
|
+
Acacia redolens
|
9
|
+
Acacia retinodes
|
10
|
+
Acacia verticillata
|
11
|
+
Acaena californica
|
12
|
+
Acanthomintha lanceolata
|
13
|
+
Acer campestre
|
14
|
+
Acer macrophyllum
|
15
|
+
Acer negundo
|
16
|
+
Achillea millefolium
|
17
|
+
Achyrachaena mollis
|
18
|
+
Acmispon americanus var. americanus
|
19
|
+
Acmispon brachycarpus
|
package/types/classes.d.ts
CHANGED
@@ -162,6 +162,13 @@ declare class InatPhoto extends Photo {
|
|
162
162
|
ext: string;
|
163
163
|
}
|
164
164
|
|
165
|
+
type InatPhotoInfo = {
|
166
|
+
id: string;
|
167
|
+
ext: string;
|
168
|
+
licenseCode: string;
|
169
|
+
attrName: string | undefined;
|
170
|
+
};
|
171
|
+
|
165
172
|
type InatLicenseCode =
|
166
173
|
| "cc-by-nc-sa"
|
167
174
|
| "cc-by-nc"
|
package/scripts/photos.js
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
|
3
|
-
import path from "path";
|
4
|
-
import { ErrorLog } from "../lib/errorlog.js";
|
5
|
-
import { Program } from "../lib/program.js";
|
6
|
-
import { Taxa } from "../lib/taxa.js";
|
7
|
-
|
8
|
-
const OPT_LOADER = "loader";
|
9
|
-
|
10
|
-
const MAX_PHOTOS = 5;
|
11
|
-
|
12
|
-
/**
|
13
|
-
* @param {import("commander").Command} program
|
14
|
-
* @param {import("commander").OptionValues} options
|
15
|
-
*/
|
16
|
-
async function photos(program, options) {
|
17
|
-
const taxa = await getTaxa(options);
|
18
|
-
const errorLog = new ErrorLog(options.outputdir + "/log.tsv", true);
|
19
|
-
|
20
|
-
auditTaxaWithoutMaxPhotos(errorLog, taxa);
|
21
|
-
|
22
|
-
errorLog.write();
|
23
|
-
}
|
24
|
-
|
25
|
-
/**
|
26
|
-
* @param {ErrorLog} errorLog
|
27
|
-
* @param {Taxa} taxa
|
28
|
-
*/
|
29
|
-
function auditTaxaWithoutMaxPhotos(errorLog, taxa) {
|
30
|
-
for (const taxon of taxa.getTaxonList()) {
|
31
|
-
const photos = taxon.getPhotos();
|
32
|
-
if (photos.length !== MAX_PHOTOS) {
|
33
|
-
errorLog.log(taxon.getName(), photos.length.toString());
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
/**
|
39
|
-
* @param {import("commander").OptionValues} options
|
40
|
-
* @return {Promise<Taxa>}
|
41
|
-
*/
|
42
|
-
async function getTaxa(options) {
|
43
|
-
const errorLog = new ErrorLog(options.outputdir + "/errors.tsv", true);
|
44
|
-
|
45
|
-
const loader = options[OPT_LOADER];
|
46
|
-
let taxa;
|
47
|
-
if (loader) {
|
48
|
-
const taxaLoaderClass = await import("file:" + path.resolve(loader));
|
49
|
-
taxa = await taxaLoaderClass.TaxaLoader.loadTaxa(options, errorLog);
|
50
|
-
} else {
|
51
|
-
taxa = new Taxa(
|
52
|
-
Program.getIncludeList(options.datadir),
|
53
|
-
errorLog,
|
54
|
-
options.showFlowerErrors,
|
55
|
-
);
|
56
|
-
}
|
57
|
-
|
58
|
-
errorLog.write();
|
59
|
-
return taxa;
|
60
|
-
}
|
61
|
-
|
62
|
-
const program = Program.getProgram();
|
63
|
-
program.option(
|
64
|
-
"--loader <path>",
|
65
|
-
"The path (relative to the current directory) of the JavaScript file containing the TaxaLoader class. If not provided, the default TaxaLoader will be used.",
|
66
|
-
);
|
67
|
-
program.action((options) => photos(program, options));
|
68
|
-
await program.parseAsync();
|