Skip to content

Commit

Permalink
Merge pull request #19 from fekad/inline_default_value
Browse files Browse the repository at this point in the history
Loading files directly
  • Loading branch information
fekad committed Jan 25, 2021
2 parents e7442d3 + fa87655 commit 900293b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions examples/1 - Basic usage.ipynb
Expand Up @@ -28,7 +28,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Loading a structure from file (by default this method loads the file \"inline\"): "
"Loading a structure from file (by default this method loads the file directly by using its path): "
]
},
{
Expand All @@ -40,7 +40,7 @@
"outputs": [],
"source": [
"view1 = JsmolView.from_file(\"data/c2h410.xyz\") \n",
"# view1 = JsmolView.from_file(\"data/c2h410.xyz\", inline=False) \n",
"# view1 = JsmolView.from_file(\"data/c2h410.xyz\", inline=True) \n",
"view1"
]
},
Expand Down Expand Up @@ -444,7 +444,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.5"
},
"pycharm": {
"stem_cell": {
Expand Down
6 changes: 3 additions & 3 deletions examples/2 - Advanced scripting.ipynb
Expand Up @@ -33,7 +33,7 @@
"metadata": {},
"outputs": [],
"source": [
"view1 = JsmolView.from_file(\"data/c2h410.xyz\", inline=False)\n",
"view1 = JsmolView.from_file(\"data/c2h410.xyz\")\n",
"view1"
]
},
Expand Down Expand Up @@ -176,7 +176,7 @@
},
"outputs": [],
"source": [
"view1 = JsmolView.from_file(\"data/c2h410.xyz\", inline=False)\n",
"view1 = JsmolView.from_file(\"data/c2h410.xyz\")\n",
"view1"
]
},
Expand Down Expand Up @@ -459,7 +459,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions examples/3 - Building an interactive view.ipynb
Expand Up @@ -89,7 +89,7 @@
"\n",
"display(view2)\n",
"\n",
"view2.load('data/CO2-DZV-hess.log', inline=False)\n",
"view2.load('data/CO2-DZV-hess.log')\n",
"# view2.script('load data/CO2-DZV-hess.log')\n",
"view2.script('frame 6; vibration SCALE 1; vibration 1')"
]
Expand All @@ -107,7 +107,7 @@
"metadata": {},
"outputs": [],
"source": [
"view3 = JsmolView.from_file(\"data/c2h410.xyz\", inline=False)\n",
"view3 = JsmolView.from_file(\"data/c2h410.xyz\")\n",
"view3"
]
},
Expand Down Expand Up @@ -168,7 +168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion js/package.json
@@ -1,6 +1,6 @@
{
"name": "jupyter-jsmol",
"version": "0.2.4",
"version": "0.2.5",
"author": {
"name": "Adam Fekete",
"email": "adam@fekete.co.uk"
Expand Down
2 changes: 1 addition & 1 deletion jupyter_jsmol/_frontend.py
Expand Up @@ -9,4 +9,4 @@
"""

module_name = "jupyter-jsmol"
module_version = "^0.2.4"
module_version = "^0.2.5"
2 changes: 1 addition & 1 deletion jupyter_jsmol/_version.py
Expand Up @@ -4,5 +4,5 @@
# Copyright (c) Adam Fekete.
# Distributed under the terms of the Modified BSD License.

version_info = (0, 2, 4)
version_info = (0, 2, 5)
__version__ = ".".join(map(str, version_info))
4 changes: 2 additions & 2 deletions jupyter_jsmol/viewer.py
Expand Up @@ -102,7 +102,7 @@ def load(self, filename: str, *args: str, inline: bool = True):
# Keeping it only for backwards compatibility.
return self.load_file(filename, *args, inline=inline)

def load_file(self, filename: str, *args: str, inline: bool = True):
def load_file(self, filename: str, *args: str, inline: bool = False):

if inline:
with open(filename, mode='r') as file:
Expand All @@ -118,7 +118,7 @@ def load_str(self, data: str, *args: str):
return self.script(script)

@classmethod
def from_file(cls, filename: str, *args: str, inline: bool = True):
def from_file(cls, filename: str, *args: str, inline: bool = False):

if inline:
with open(filename, mode='r') as file:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -28,7 +28,7 @@
description='JSmol viewer widget for Jupyter',
long_description=long_description,
long_description_content_type="text/markdown",
version='0.2.4',
version='0.2.5',
author='Adam Fekete',
author_email='adam@fekete.co.uk',
url='https://github.com/fekad/jupyter-jsmol',
Expand Down

0 comments on commit 900293b

Please sign in to comment.