Skip to content

Commit

Permalink
more cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesll committed Sep 30, 2024
1 parent 5d6fc6d commit 453ea95
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 30 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## NEWS

### V2.1.2
### V2.1.3

- update build process for PyPI

Expand Down
Binary file removed data/NKCMAS_Raman.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_abbe.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_cp.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_cte.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_density.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_em.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_optical.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_tl.hdf5
Binary file not shown.
Binary file removed data/NKCMAS_viscosity.hdf5
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Charles Le Losq, Barbara Baldoni, Andrew P. Valentine'

# The full version, including alpha/beta/rc tags
release = '2.1.2'
release = '2.1.3'


# -- General configuration ---------------------------------------------------
Expand Down
95 changes: 88 additions & 7 deletions examples/Predict_given_property.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,89 @@
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"A module that was compiled using NumPy 1.x cannot be run in\n",
"NumPy 2.1.1 as it may crash. To support both 1.x and 2.x\n",
"versions of NumPy, modules must be compiled with NumPy 2.0.\n",
"Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
"\n",
"If you are a user of the module, the easiest solution will be to\n",
"downgrade to 'numpy<2' or try to upgrade the affected module.\n",
"We expect that some modules will need time to support NumPy 2.\n",
"\n",
"Traceback (most recent call last): File \"<frozen runpy>\", line 198, in _run_module_as_main\n",
" File \"<frozen runpy>\", line 88, in _run_code\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel_launcher.py\", line 18, in <module>\n",
" app.launch_new_instance()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/traitlets/config/application.py\", line 1075, in launch_instance\n",
" app.start()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/kernelapp.py\", line 739, in start\n",
" self.io_loop.start()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/tornado/platform/asyncio.py\", line 205, in start\n",
" self.asyncio_loop.run_forever()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/asyncio/base_events.py\", line 608, in run_forever\n",
" self._run_once()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/asyncio/base_events.py\", line 1936, in _run_once\n",
" handle._run()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/asyncio/events.py\", line 84, in _run\n",
" self._context.run(self._callback, *self._args)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/kernelbase.py\", line 545, in dispatch_queue\n",
" await self.process_one()\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/kernelbase.py\", line 534, in process_one\n",
" await dispatch(*args)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/kernelbase.py\", line 437, in dispatch_shell\n",
" await result\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/ipkernel.py\", line 362, in execute_request\n",
" await super().execute_request(stream, ident, parent)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/kernelbase.py\", line 778, in execute_request\n",
" reply_content = await reply_content\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/ipkernel.py\", line 449, in do_execute\n",
" res = shell.run_cell(\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/ipykernel/zmqshell.py\", line 549, in run_cell\n",
" return super().run_cell(*args, **kwargs)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3075, in run_cell\n",
" result = self._run_cell(\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3130, in _run_cell\n",
" result = runner(coro)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/async_helpers.py\", line 128, in _pseudo_sync_runner\n",
" coro.send(None)\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3334, in run_cell_async\n",
" has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3517, in run_ast_nodes\n",
" if await self.run_code(code, result, async_=asy):\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \"/var/folders/23/p99d2kmd0vlg5qrqb4vq2q840000gn/T/ipykernel_10699/207192867.py\", line 12, in <module>\n",
" import imelt\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/imelt/__init__.py\", line 1, in <module>\n",
" from .model import *\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/imelt/model.py\", line 6, in <module>\n",
" import torch, time\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/__init__.py\", line 1477, in <module>\n",
" from .functional import * # noqa: F403\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/functional.py\", line 9, in <module>\n",
" import torch.nn.functional as F\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/nn/__init__.py\", line 1, in <module>\n",
" from .modules import * # noqa: F403\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/nn/modules/__init__.py\", line 35, in <module>\n",
" from .transformer import TransformerEncoder, TransformerDecoder, \\\n",
" File \"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/nn/modules/transformer.py\", line 20, in <module>\n",
" device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'),\n",
"/Users/charleslelosq/anaconda3/envs/ml/lib/python3.11/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n",
" device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'),\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CUDA AVAILABLE? \n",
"Yes, setting device to cuda\n",
"cuda\n"
"No, setting device to cpu\n",
"cpu\n"
]
}
],
Expand Down Expand Up @@ -86,10 +162,15 @@
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The configurational entropy at Tg is 1424.1 J/mol/K\n"
"ename": "RuntimeError",
"evalue": "Numpy is not available",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m X_SiO2 \u001b[38;5;241m=\u001b[39m imelt\u001b[38;5;241m.\u001b[39mgenerate_query_single(sio2\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m100.0\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m sctg_SiO2 \u001b[38;5;241m=\u001b[39m \u001b[43mneuralmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpredict\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtg\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mX_SiO2\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe configurational entropy at Tg is \u001b[39m\u001b[38;5;132;01m{:.1f}\u001b[39;00m\u001b[38;5;124m J/mol/K\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(sctg_SiO2[\u001b[38;5;241m0\u001b[39m]))\n",
"File \u001b[0;32m~/anaconda3/envs/ml/lib/python3.11/site-packages/imelt/model.py:2121\u001b[0m, in \u001b[0;36mbagging_models.predict\u001b[0;34m(self, method, X, T, lbd, sampling, n_sample)\u001b[0m\n\u001b[1;32m 2115\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2116\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mn_models):\n\u001b[1;32m 2117\u001b[0m out[:, i] \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 2118\u001b[0m \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmodels\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2119\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcpu\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2120\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdetach\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m-> 2121\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnumpy\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2122\u001b[0m \u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m 2123\u001b[0m )\n\u001b[1;32m 2125\u001b[0m \u001b[38;5;66;03m# Before leaving this function, we make sure we freeze again the dropout\u001b[39;00m\n\u001b[1;32m 2126\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mn_models):\n",
"\u001b[0;31mRuntimeError\u001b[0m: Numpy is not available"
]
}
],
Expand Down Expand Up @@ -424,7 +505,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.11.10"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "imelt"
version = "2.1.2"
version = "2.1.3"
dependencies = [
"matplotlib",
"numpy",
Expand Down
20 changes: 0 additions & 20 deletions requirements.txt

This file was deleted.

0 comments on commit 453ea95

Please sign in to comment.