@ccp-nc/crystvis-js 0.5.0 → 0.6.1

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.
Files changed (179) hide show
  1. package/.github/dependabot.yml +69 -0
  2. package/.github/workflows/dependency-review.yml +91 -0
  3. package/.github/workflows/security-scan.yml +113 -0
  4. package/.github/workflows/test.yml +191 -0
  5. package/.github/workflows/update-dependencies.yml +214 -0
  6. package/CHANGELOG.md +36 -0
  7. package/LICENSE +0 -0
  8. package/README.html +0 -0
  9. package/README.md +5 -1
  10. package/audit.txt +37 -0
  11. package/changes.txt +27 -0
  12. package/docs/.nojekyll +0 -0
  13. package/docs/data/search.json +1 -0
  14. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  15. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  16. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  17. package/docs/index.html +10 -0
  18. package/docs/lib_model.module_js-AtomImage.html +3 -0
  19. package/docs/lib_model.module_js-BondImage.html +3 -0
  20. package/docs/lib_model.module_js-Model.html +3 -0
  21. package/docs/lib_model.module_js.html +3 -0
  22. package/docs/lib_modelview.module_js-ModelView.html +12 -0
  23. package/docs/lib_modelview.module_js.html +3 -0
  24. package/docs/lib_visualizer.module_js-CrystVis.html +3 -0
  25. package/docs/lib_visualizer.module_js.html +3 -0
  26. package/docs/model.js.html +2160 -0
  27. package/docs/modelview.js.html +449 -0
  28. package/docs/scripts/core.js +726 -0
  29. package/docs/scripts/core.min.js +23 -0
  30. package/docs/scripts/resize.js +90 -0
  31. package/docs/scripts/search.js +265 -0
  32. package/docs/scripts/search.min.js +6 -0
  33. package/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
  34. package/docs/scripts/third-party/fuse.js +9 -0
  35. package/docs/scripts/third-party/hljs-line-num-original.js +369 -0
  36. package/docs/scripts/third-party/hljs-line-num.js +1 -0
  37. package/docs/scripts/third-party/hljs-original.js +5171 -0
  38. package/docs/scripts/third-party/hljs.js +1 -0
  39. package/docs/scripts/third-party/popper.js +5 -0
  40. package/docs/scripts/third-party/tippy.js +1 -0
  41. package/docs/scripts/third-party/tocbot.js +672 -0
  42. package/docs/scripts/third-party/tocbot.min.js +1 -0
  43. package/docs/styles/clean-jsdoc-theme-base.css +1159 -0
  44. package/docs/styles/clean-jsdoc-theme-dark.css +412 -0
  45. package/docs/styles/clean-jsdoc-theme-light.css +482 -0
  46. package/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  47. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  48. package/docs/styles/clean-jsdoc-theme.min.css +1 -0
  49. package/docs/tutorial-Events.html +13 -0
  50. package/docs/tutorial-Queries.html +16 -0
  51. package/docs/tutorial-ThreejsMigration.html +25 -0
  52. package/docs/visualizer.js.html +574 -0
  53. package/docs-tutorials/Events.md +0 -0
  54. package/docs-tutorials/Queries.md +0 -0
  55. package/docs-tutorials/ThreejsMigration.md +96 -0
  56. package/eslint.config.js +41 -0
  57. package/fonts/OpenSans/OFL.txt +0 -0
  58. package/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth,wght.ttf +0 -0
  59. package/fonts/OpenSans/OpenSans-VariableFont_wdth,wght.ttf +0 -0
  60. package/fonts/OpenSans/README.txt +0 -0
  61. package/fonts/OpenSans/static/OpenSans/OpenSans-Bold.ttf +0 -0
  62. package/fonts/OpenSans/static/OpenSans/OpenSans-BoldItalic.ttf +0 -0
  63. package/fonts/OpenSans/static/OpenSans/OpenSans-ExtraBold.ttf +0 -0
  64. package/fonts/OpenSans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf +0 -0
  65. package/fonts/OpenSans/static/OpenSans/OpenSans-Italic.ttf +0 -0
  66. package/fonts/OpenSans/static/OpenSans/OpenSans-Light.ttf +0 -0
  67. package/fonts/OpenSans/static/OpenSans/OpenSans-LightItalic.ttf +0 -0
  68. package/fonts/OpenSans/static/OpenSans/OpenSans-Medium.ttf +0 -0
  69. package/fonts/OpenSans/static/OpenSans/OpenSans-MediumItalic.ttf +0 -0
  70. package/fonts/OpenSans/static/OpenSans/OpenSans-Regular.ttf +0 -0
  71. package/fonts/OpenSans/static/OpenSans/OpenSans-SemiBold.ttf +0 -0
  72. package/fonts/OpenSans/static/OpenSans/OpenSans-SemiBoldItalic.ttf +0 -0
  73. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf +0 -0
  74. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf +0 -0
  75. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf +0 -0
  76. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf +0 -0
  77. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf +0 -0
  78. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf +0 -0
  79. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf +0 -0
  80. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf +0 -0
  81. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf +0 -0
  82. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf +0 -0
  83. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf +0 -0
  84. package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf +0 -0
  85. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf +0 -0
  86. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf +0 -0
  87. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf +0 -0
  88. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf +0 -0
  89. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf +0 -0
  90. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf +0 -0
  91. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf +0 -0
  92. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf +0 -0
  93. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf +0 -0
  94. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf +0 -0
  95. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf +0 -0
  96. package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf +0 -0
  97. package/fonts/Rubik/OFL.txt +0 -0
  98. package/fonts/Rubik/README.txt +0 -0
  99. package/fonts/Rubik/Rubik-Italic-VariableFont_wght.ttf +0 -0
  100. package/fonts/Rubik/Rubik-VariableFont_wght.ttf +0 -0
  101. package/fonts/Rubik/static/Rubik-Black.ttf +0 -0
  102. package/fonts/Rubik/static/Rubik-BlackItalic.ttf +0 -0
  103. package/fonts/Rubik/static/Rubik-Bold.ttf +0 -0
  104. package/fonts/Rubik/static/Rubik-BoldItalic.ttf +0 -0
  105. package/fonts/Rubik/static/Rubik-ExtraBold.ttf +0 -0
  106. package/fonts/Rubik/static/Rubik-ExtraBoldItalic.ttf +0 -0
  107. package/fonts/Rubik/static/Rubik-Italic.ttf +0 -0
  108. package/fonts/Rubik/static/Rubik-Light.ttf +0 -0
  109. package/fonts/Rubik/static/Rubik-LightItalic.ttf +0 -0
  110. package/fonts/Rubik/static/Rubik-Medium.ttf +0 -0
  111. package/fonts/Rubik/static/Rubik-MediumItalic.ttf +0 -0
  112. package/fonts/Rubik/static/Rubik-Regular.ttf +0 -0
  113. package/fonts/Rubik/static/Rubik-SemiBold.ttf +0 -0
  114. package/fonts/Rubik/static/Rubik-SemiBoldItalic.ttf +0 -0
  115. package/index.html +0 -0
  116. package/index.js +0 -0
  117. package/jsconf.json +0 -0
  118. package/lib/assets/fonts/bmpfonts.in.js +0 -0
  119. package/lib/assets/fonts/bmpfonts.js +0 -0
  120. package/lib/assets/fonts/font.js +33 -3
  121. package/lib/assets/fonts/index.js +0 -0
  122. package/lib/assets/fonts/threebmfont.js +2 -12
  123. package/lib/data.js +0 -0
  124. package/lib/formats/cell.js +0 -0
  125. package/lib/formats/cif.js +0 -0
  126. package/lib/formats/magres.js +0 -0
  127. package/lib/formats/xyz.js +149 -52
  128. package/lib/loader.js +28 -7
  129. package/lib/model.js +10 -3
  130. package/lib/modelview.js +30 -0
  131. package/lib/nmrdata.js +0 -0
  132. package/lib/orbit.js +77 -1
  133. package/lib/primitives/atoms.js +12 -7
  134. package/lib/primitives/cell.js +1 -1
  135. package/lib/primitives/dither.js +1 -1
  136. package/lib/primitives/ellipsoid.js +22 -8
  137. package/lib/primitives/geometries.js +3 -3
  138. package/lib/primitives/isosurface.js +2 -6
  139. package/lib/primitives/shapes.js +1 -1
  140. package/lib/primitives/sprites.js +9 -2
  141. package/lib/query.js +3 -28
  142. package/lib/render.js +40 -9
  143. package/lib/selbox.js +0 -0
  144. package/lib/shaders/aura.frag +0 -1
  145. package/lib/shaders/aura.vert +0 -1
  146. package/lib/shaders/dither.frag +0 -0
  147. package/lib/shaders/dither.vert +0 -0
  148. package/lib/shaders/index.in.js +0 -0
  149. package/lib/shaders/index.js +4 -4
  150. package/lib/shaders/msdf300.frag +0 -2
  151. package/lib/shaders/msdf300.vert +0 -2
  152. package/lib/tensor.js +0 -1
  153. package/lib/visualizer.js +5 -4
  154. package/outdated.txt +12 -0
  155. package/package.json +21 -22
  156. package/scripts/build-bundle.js +6 -2
  157. package/scripts/build-resources.js +0 -0
  158. package/scripts/plugins-shim.js +0 -0
  159. package/test/data/CHA.cif +0 -0
  160. package/test/data/H2O.xyz +0 -0
  161. package/test/data/H2_bound.xyz +0 -0
  162. package/test/data/bohr.cell +0 -0
  163. package/test/data/ethanol.cell +0 -0
  164. package/test/data/ethanol_with_tensors.xyz +33 -0
  165. package/test/data/example_single.cif +0 -0
  166. package/test/data/frac.cell +0 -0
  167. package/test/data/org.cif +0 -0
  168. package/test/data/pyridine.xyz +0 -0
  169. package/test/data/si8.xyz +0 -0
  170. package/test/loader.js +168 -8
  171. package/test/model.js +2 -4
  172. package/test/test-html/examples.js +0 -0
  173. package/test/test-html/index.html +0 -0
  174. package/tools/compile_colors.py +0 -0
  175. package/tools/compile_periodic.py +0 -0
  176. package/tools/ptable.json +0 -0
  177. package/tools/test +0 -0
  178. package/.eslintrc.json +0 -16
  179. package/.github/workflows/test-mocha.yml +0 -30
package/test/loader.js CHANGED
@@ -26,7 +26,22 @@ describe('#loading', function() {
26
26
  expect(a.get_chemical_symbols()).to.deep.equal(['C', 'C', 'C', 'N', 'C', 'C',
27
27
  'H', 'H', 'H', 'H', 'H'
28
28
  ]);
29
+
30
+ // Check that positions were loaded correctly
31
+ expect(a.length()).to.equal(11);
32
+ expect(a.get_positions()[0]).to.deep.almost.equal([-0.180226841, 0.360945118, -1.120304970]);
33
+
34
+ // Check cell
35
+ expect(a.get_cell()).to.deep.almost.equal([
36
+ [10, 0, 0],
37
+ [0, 10, 0],
38
+ [0, 0, 10]
39
+ ]);
40
+
41
+ // Check that info contains the label
42
+ expect(a.info.Label).to.equal('Pyridine molecule (source: Wikipedia)');
29
43
  });
44
+
30
45
  it('should load properly an extended XYZ file', function() {
31
46
 
32
47
  var loader = new Loader();
@@ -40,22 +55,119 @@ describe('#loading', function() {
40
55
  [0, 0, 5.44]
41
56
  ]);
42
57
  expect(a.get_array('spin')).to.deep.equal([1, 0, 0, 0, 0, 0, 0, 0]);
58
+ expect(a.length()).to.equal(8);
59
+ expect(a.get_chemical_symbols()[0]).to.equal('Si');
43
60
  });
44
- it('should load properly a CIF file', function() {
45
61
 
62
+ it('should load all frames from a multi-frame extended XYZ file and be robust to blank lines', function() {
46
63
  var loader = new Loader();
64
+ var xyz = fs.readFileSync(path.join(__dirname, 'data', 'ethanol_with_tensors.xyz'), "utf8");
47
65
 
48
- var cif = fs.readFileSync(path.join(__dirname, 'data', 'org.cif'), "utf8");
49
- var a = loader.load(cif)['1501936'];
66
+ // Frame 0 (first)
67
+ var a0 = loader.load(xyz, 'xyz', null, { index: 0 })['xyz'];
68
+ expect(a0.length()).to.equal(9);
69
+ expect(a0.get_chemical_symbols()[0]).to.equal('C');
70
+ expect(a0.get_positions()[0]).to.deep.almost.equal([0.05539939, -0.60057807, 0.62649405]);
71
+
72
+ // Check that ms tensors were loaded as TensorData objects
73
+ expect(a0.get_array('ms')).to.have.lengthOf(9);
74
+ expect(a0.get_array('ms')[0]).to.have.property('data');
75
+ expect(a0.get_array('ms')[0].data).to.deep.almost.equal([
76
+ [125.81813960, -9.69204056, 1.47151834],
77
+ [-9.69204056, 152.57296730, -15.37444798],
78
+ [1.47151834, -15.37444798, 153.40518054]
79
+ ]);
50
80
 
81
+ // Frame 1 (second)
82
+ var a1 = loader.load(xyz, 'xyz', null, { index: 1 })['xyz'];
83
+ expect(a1.length()).to.equal(9);
84
+ expect(a1.get_positions()[0]).to.deep.almost.equal([-0.40320021, -0.45122528, 0.73024166]);
85
+ expect(a1.get_array('ms')[0].data).to.deep.almost.equal([
86
+ [132.90497460, 3.59552794, -12.43391876],
87
+ [3.59552794, 127.77706275, -12.28247854],
88
+ [-12.43391876, -12.28247854, 148.26339821]
89
+ ]);
51
90
 
52
- chai.expect(a.get_cell()).to.deep.almost.equal([
53
- [8.2302, 0.0, 0.0],
54
- [1.7507207912272031, 8.096583378263006, 0.0],
55
- [1.7848106706548383, 1.959874486240255, 12.914460443940394]
91
+ // Frame 2 (third)
92
+ var a2 = loader.load(xyz, 'xyz', null, { index: 2 })['xyz'];
93
+ expect(a2.length()).to.equal(9);
94
+ expect(a2.get_positions()[0]).to.deep.almost.equal([-0.69807410, -0.44723904, 0.24317208]);
95
+ expect(a2.get_array('ms')[0].data).to.deep.almost.equal([
96
+ [152.92455307, 16.26391385, -4.26821306],
97
+ [16.26391385, 125.77540629, -16.76320152],
98
+ [-4.26821306, -16.76320152, 130.73689699]
99
+ ]);
100
+
101
+ // Check a different atom in frame 2
102
+ expect(a2.get_array('ms')[8].data).to.deep.almost.equal([
103
+ [15.18096611, -3.57189977, -7.34818913],
104
+ [-3.57189977, 25.05233266, -0.90280873],
105
+ [-7.34818913, -0.90280873, 24.27668518]
106
+ ]);
107
+
108
+ // Default (should be last frame)
109
+ var a_last = loader.load(xyz, 'xyz')['xyz'];
110
+ expect(a_last.get_array('ms')[0].data).to.deep.almost.equal([
111
+ [152.92455307, 16.26391385, -4.26821306],
112
+ [16.26391385, 125.77540629, -16.76320152],
113
+ [-4.26821306, -16.76320152, 130.73689699]
114
+ ]);
115
+
116
+ // Robustness: insert blank lines between frames and test again
117
+ // add blank line before each frame (match only counts at start of line)
118
+ var xyz_blank = xyz.replace(/^9\n/gm, '\n9\n');
119
+ var a_blank = loader.load(xyz_blank, 'xyz', null, { index: 1 })['xyz'];
120
+ expect(a_blank.get_array('ms')[0].data).to.deep.almost.equal([
121
+ [132.90497460, 3.59552794, -12.43391876],
122
+ [3.59552794, 127.77706275, -12.28247854],
123
+ [-12.43391876, -12.28247854, 148.26339821]
124
+ ]);
125
+ });
126
+
127
+ it('should handle negative frame indices correctly', function() {
128
+ var loader = new Loader();
129
+ var xyz = fs.readFileSync(path.join(__dirname, 'data', 'ethanol_with_tensors.xyz'), "utf8");
130
+
131
+ // -1 should be last frame (frame 2)
132
+ var a_neg1 = loader.load(xyz, 'xyz', null, { index: -1 })['xyz'];
133
+ expect(a_neg1.get_array('ms')[0].data[0][0]).to.almost.equal(152.92455307);
134
+
135
+ // -2 should be second-to-last frame (frame 1)
136
+ var a_neg2 = loader.load(xyz, 'xyz', null, { index: -2 })['xyz'];
137
+ expect(a_neg2.get_array('ms')[0].data[0][0]).to.almost.equal(132.90497460);
138
+
139
+ // -3 should be first frame (frame 0)
140
+ var a_neg3 = loader.load(xyz, 'xyz', null, { index: -3 })['xyz'];
141
+ expect(a_neg3.get_array('ms')[0].data[0][0]).to.almost.equal(125.81813960);
142
+ });
143
+
144
+ it('should load properly a simple XYZ file with multiple atoms', function() {
145
+ var loader = new Loader();
146
+ var xyz = fs.readFileSync(path.join(__dirname, 'data', 'H2O.xyz'), "utf8");
147
+ var a = loader.load(xyz, 'xyz')['xyz'];
148
+
149
+ expect(a.length()).to.equal(6);
150
+ expect(a.get_chemical_symbols()).to.deep.equal(['O', 'H', 'H', 'O', 'H', 'H']);
151
+ expect(a.get_positions()[0]).to.deep.almost.equal([0.0, 0.0, 0.11926200]);
152
+ expect(a.get_cell()).to.deep.almost.equal([
153
+ [10, 0, 0],
154
+ [0, 10, 0],
155
+ [0, 0, 10]
56
156
  ]);
57
157
  });
58
- it ('should load a noisy .xyz file', function() {
158
+
159
+ it('should load properly a file with periodic boundary conditions across cell', function() {
160
+ var loader = new Loader();
161
+ var xyz = fs.readFileSync(path.join(__dirname, 'data', 'H2_bound.xyz'), "utf8");
162
+ var a = loader.load(xyz, 'xyz')['xyz'];
163
+
164
+ expect(a.length()).to.equal(2);
165
+ expect(a.get_chemical_symbols()).to.deep.equal(['H', 'H']);
166
+ expect(a.get_positions()[0]).to.deep.almost.equal([0.2, 0.2, 0.2]);
167
+ expect(a.get_positions()[1]).to.deep.almost.equal([9.8, 9.8, 9.8]);
168
+ });
169
+
170
+ it('should load a noisy .xyz file', function() {
59
171
 
60
172
  var loader = new Loader();
61
173
 
@@ -67,6 +179,54 @@ describe('#loading', function() {
67
179
  [0, 5.475, 0],
68
180
  [0, 0, 5.475]
69
181
  ]);
182
+
183
+ // Check that it loaded the right number of atoms
184
+ expect(a.length()).to.equal(8);
185
+
186
+ // Check that initial_magmoms were loaded (all zeros)
187
+ expect(a.get_array('initial_magmoms')).to.deep.almost.equal([0, 0, 0, 0, 0, 0, 0, 0]);
188
+
189
+ // Check that castep_labels were loaded (all "NULL")
190
+ expect(a.get_array('castep_labels')).to.deep.equal(['NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL']);
191
+ });
192
+
193
+ it('should throw an error for files without a lattice', function() {
194
+ var loader = new Loader();
195
+
196
+ // Create a plain XYZ file without Extended XYZ format
197
+ var plain_xyz = `3
198
+ water molecule
199
+ O 0.0 0.0 0.0
200
+ H 1.0 0.0 0.0
201
+ H 0.0 1.0 0.0`;
202
+
203
+ expect(() => loader.load(plain_xyz, 'xyz')).to.throw('No unit cell');
204
+ });
205
+
206
+ it('should throw an error for invalid frame indices', function() {
207
+ var loader = new Loader();
208
+ var xyz = fs.readFileSync(path.join(__dirname, 'data', 'ethanol_with_tensors.xyz'), "utf8");
209
+
210
+ // Frame index too high
211
+ expect(() => loader.load(xyz, 'xyz', null, { index: 10 })).to.throw('Frame index out of range');
212
+
213
+ // Frame index too low (negative)
214
+ expect(() => loader.load(xyz, 'xyz', null, { index: -10 })).to.throw('Frame index out of range');
215
+ });
216
+
217
+ it('should load properly a CIF file', function() {
218
+
219
+ var loader = new Loader();
220
+
221
+ var cif = fs.readFileSync(path.join(__dirname, 'data', 'org.cif'), "utf8");
222
+ var a = loader.load(cif)['1501936'];
223
+
224
+
225
+ chai.expect(a.get_cell()).to.deep.almost.equal([
226
+ [8.2302, 0.0, 0.0],
227
+ [1.7507207912272031, 8.096583378263006, 0.0],
228
+ [1.7848106706548383, 1.959874486240255, 12.914460443940394]
229
+ ]);
70
230
  });
71
231
 
72
232
  it('should load properly a Magres file', function() {
package/test/model.js CHANGED
@@ -19,9 +19,6 @@ import {
19
19
  AtomImage,
20
20
  BondImage
21
21
  } from '../lib/model.js';
22
- import {
23
- ModelView as ModelView
24
- } from '../lib/modelview.js';
25
22
  import {
26
23
  Loader as Loader
27
24
  } from '../lib/loader.js';
@@ -50,7 +47,8 @@ var loader = new Loader();
50
47
  try {
51
48
  loader.load(xyz, 'xyz');
52
49
  } catch (e) {
53
- expect(e.message).to.be.equal('No unit cell found in xyz file');
50
+ // Accept either the short legacy message or the more descriptive one
51
+ expect(e.message).to.match(/No unit cell/);
54
52
  }
55
53
 
56
54
  // manually added in dummy cell:
File without changes
File without changes
File without changes
File without changes
package/tools/ptable.json CHANGED
File without changes
package/tools/test CHANGED
File without changes
package/.eslintrc.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "es2021": true
5
- },
6
- "extends": "eslint:recommended",
7
- "parserOptions": {
8
- "ecmaVersion": 12,
9
- "sourceType": "module"
10
- },
11
- "rules": {
12
- "no-unused-vars": ["error", {
13
- "args": "none"
14
- }]
15
- }
16
- }
@@ -1,30 +0,0 @@
1
- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name: Node.js CI
5
-
6
- on:
7
- push:
8
- branches: [ master ]
9
- pull_request:
10
- branches: [ master ]
11
-
12
- jobs:
13
- build:
14
-
15
- runs-on: ubuntu-latest
16
-
17
- strategy:
18
- matrix:
19
- node-version: [12.x, 14.x, 16.x, 18.x]
20
- # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
-
22
- steps:
23
- - uses: actions/checkout@v2
24
- - name: Use Node.js ${{ matrix.node-version }}
25
- uses: actions/setup-node@v2
26
- with:
27
- node-version: ${{ matrix.node-version }}
28
- - run: npm ci
29
- - run: npm run build --if-present
30
- - run: npm test