-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Interface (#74) * Add prelude #63 * Make a step plot * Add a new interface, Session * Check dimensionality * #19 Support a new keyword, proceed * #19 Enable to extend reserved keywords * Implement ensemble * session.Result is picklable * Use run_ensemble * Move ecell4.util.viz -> ecell4.plotting * ecell4.util.viz will be deprecated * get_range_of_world and get_range_of_trajectories are moved into _core * Copy deep * Add plotting._plotly * Add a datasource for STRING * Add idmapping using UniProt * Interface2 (#75) * Set method * Add more options * Fix silly mistakes * #11 Enable rich display * Session.run accepts numpy.ndarray as t * Arithmetic representations in y * Enable to set own observable in _plotly * Split elegans-based plot functions into _elegans * Format before assignment * Rename plotting.default -> BACKEND * Enable rule-based descriptions in observables * Enable observables in plotting.plot_number_observer (#77) * Session.run accepts numpy.ndarray as t * Arithmetic representations in y * Enable to set own observable in _plotly * Split elegans-based plot functions into _elegans * Format before assignment * Rename plotting.default -> BACKEND * Enable rule-based descriptions in observables * Load submodules * Skip some submodules * Remove a duplicated file * Remove all * Update version * Import all from submodules * Set __all__ * Rather use the common name * Update the relative module path * Move display_anim into _core * Enable ndiv * Fix for pi * Enable to change figsize in _matplotlib * Add DOI * Add citation * Update the citation outputs * Import citation in prelude * Put a space after a comma * load_world is already imported * Cast to an integer * Enable to fetch an abstract * Remove an unnecessary module * Simplify run_simulation and ensemble_simulations, and deprecate old implementations * The config yaml is loaded if existing * Add plot_trajectory in _plotly * Change the default renderer on Google Colab * Try STL visualization in Plotly * Set opacity * Use default colorscale * Update * Enable to show stl * Enable to check dimensionality of units in a model
- Loading branch information
Showing
28 changed files
with
3,600 additions
and
2,655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from ecell4.util import * | ||
|
||
__version__ = '0.1.0' | ||
__version__ = '1.2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import urllib | ||
import time | ||
|
||
import requests | ||
|
||
|
||
class StringDataSource: | ||
""" | ||
See http://string-db.org/cgi/help.pl | ||
""" | ||
|
||
wait = 1.0 | ||
|
||
def __init__(self): | ||
pass | ||
|
||
@classmethod | ||
def network(cls, entity, output_format='highres_image', **optional_parameters): | ||
""" | ||
Display STRING network image. | ||
Parameters | ||
---------- | ||
output_format : str, optional | ||
'image' or 'highres_image'. | ||
""" | ||
if isinstance(entity, str): | ||
identifiers = [entity] | ||
else: | ||
raise TypeError(f'The given identifier [{entity}] is invalid.') | ||
|
||
parameters = {'identifiers': '\r'.join(identifiers)} | ||
parameters.update(optional_parameters) | ||
|
||
url = "https://string-db.org/api/{}/network?{}".format( | ||
output_format, urllib.parse.urlencode(parameters)) | ||
response = requests.get(url) | ||
time.sleep(cls.wait) | ||
|
||
from IPython.display import Image, display_png | ||
display_png(Image(response.content)) | ||
|
||
@classmethod | ||
def interaction_partners(cls, entity, **optional_parameters): | ||
if isinstance(entity, str): | ||
identifiers = [entity] | ||
else: | ||
raise TypeError(f'The given identifier [{entity}] is invalid.') | ||
|
||
parameters = {'identifiers': '\r'.join(identifiers)} | ||
parameters.update(optional_parameters) | ||
|
||
output_format = 'json' | ||
url = "https://string-db.org/api/{}/interaction_partners?{}".format( | ||
output_format, urllib.parse.urlencode(parameters)) | ||
response = requests.get(url) | ||
time.sleep(cls.wait) | ||
return response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.