anybody-research-group / anypytools Goto Github PK
View Code? Open in Web Editor NEWPython tools and utilities for working with the AnyBody Modelling System
Home Page: https://anybody-research-group.github.io/anypytools
License: MIT License
Python tools and utilities for working with the AnyBody Modelling System
Home Page: https://anybody-research-group.github.io/anypytools
License: MIT License
It could be convinient if the library could detect a messed up windows registry for AnyBody.
Then provide a suggestion for reinstalling AnyBody.
If for example the following key is empty
Computer\HKEY_CLASSES_ROOT\AnyBody.AnyScript\shell\open\command
Running the dump classoperation on a folder or folder reference causes this error in
_parse_anybodycon_output(strvar)
ValueError: malformed string
This can happen if we try to dump a variable with file path
Hello again,
Its Ogulcan, really appreciated your support! Like you suggested I tried everything and now I am opening a new issue. As a summary, I do have a usb drive with anybody setup, anaconda setup, anybody license file and model we are using. I am using same usb drive to install all of those softwares and using the same model, all other computers run the code except mine, I am getting KeyError everytime. So like you said it is not a problem caused by model differences. I
If you need I can provide anything you need to solve this issue. Thank you for your support once again! Hope to solve this problem as soon as possible.
Ogulcan Guldeniz
When the license server password is wrong AnyBody fails with returncode 234,
AnyPyTools should report a more explanatory message.
ERROR: AnyPyTools : anybodycon.exe exited unexpectedly. Return code: 234
Your first link on landing page (the AMS) is broken.
Setting value of Data of an AnyFunInterpol through SetValue, does not work as expected.
I have this AnyScript:
T = {0, 0.016, 0.024, 1};
Data = DesignVar({{<DATA>}});
Type = PiecewiseLinear;
};
and this Python-code:
values = ["{{0,0,0,0}}", "{{0.01, 0.01, 0, 0}}", "{{0.02, 0.02, 0, 0}}"];
macro = [
Load('main.any'),
SetValue('Main.Model.ErrorFun.Data', values),
OperationRun('Main.RunApplication'),
Dump('Main.Study.Output.Model.Dist.Pos'),
Dump('Main.Model.ErrorFun.Data')
]
macro_list = AnyMacro(macro, number_of_macros=len(values))
filevalues_macro = [
Load('main.any'),
OperationRun('Main.RunApplication'),
Dump('Main.Study.Output.Model.Dist.Pos'),
Dump('Main.Model.ErrorFun.Data')
]
baseline_macro = AnyMacro(baseline)
app = AnyPyProcess(num_process = 4)
results = app.start_macro(macro_list)
fv_results = app.start_macro(AnyMacro(filevalues_macro))
for result in results:
plt.plot(result['Main.Study.Output.Model.Dist.Pos'], label=result['Main.Model.ErrorFun.Data'])
lbl = "File values: ["+", ".join(str(x) for x in fv_results[0]["Main.Model.ErrorFun.Data"][0])+"]"
plt.plot(fv_results[0]['Main.Study.Output.Model.Dist.Pos'], "--", label=lbl)
plt.legend()
plt.show()
Setting to 0,0,0,0 gives this plot: http://pasteall.org/pic/show.php?id=119069
Setting to 0.01, 0.01, 0, 0 gives this plot: http://pasteall.org/pic/show.php?id=119070
Setting to 0.02, 0.02, 0, 0 gives this plot: http://pasteall.org/pic/show.php?id=119071
I would have expected that the solid lines were the same on all plots.
The limits to the number of current processes in version 7.0 seems to cause a problem when the user sets number_of_process
to a higher number
app = AnyPyProcess(number_of_processes = 16)
I suspect this is caused by AnyPyTools suppressing all popup windows from AnyBody which cause all process to pause.
This most likely happens because the repr skips the "task_*" variables in the data and hence doesn't properly close the printed scope
I'm running AnyPyTools as a package in an Anaconda environment. When I try to run the first commands of the AnyPyTools "getting started" jupyter notebook, I get an error that says "Could not locate AnyBody in registry". Any ideas on how to deal with that?
I tried uninstalling & re-installing AnyPyTools, with a shutdown in between, but still get the same error. Also, I can't find a separate AnyBody package.
(from http://localhost:8888/notebooks/01_Getting_started_with_anypytools.ipynb)
from anypytools import AnyPyProcess
app = AnyPyProcess()
OSError: Could not locate AnyBody in registry
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\anypytools\tools.py in get_anybodycon_path()
461 try:
--> 462 abpath = winreg.QueryValue(
463 winreg.HKEY_CLASSES_ROOT, "AnyBody.AnyScript\\shell\\open\\command"
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_11000/586603320.py in <module>
1 from anypytools import AnyPyProcess
----> 2 app = AnyPyProcess()
~\Anaconda3\lib\site-packages\anypytools\abcutils.py in __init__(self, num_processes, anybodycon_path, timeout, silent, ignore_errors, warnings_to_include, fatal_warnings, return_task_info, keep_logfiles, logfile_prefix, python_env, debug_mode, use_gui, priority, **kwargs)
537
538 if anybodycon_path is None:
--> 539 anybodycon_path = get_anybodycon_path()
540 anybodycon_path = Path(anybodycon_path)
541 if use_gui:
~\Anaconda3\lib\site-packages\anypytools\tools.py in get_anybodycon_path()
464 )
465 except WindowsError:
--> 466 raise WindowsError("Could not locate AnyBody in registry")
467 abpath = abpath.rsplit(" ", 1)[0].strip('"')
468 abpath = os.path.join(os.path.dirname(abpath), "AnyBodyCon.exe")
OSError: Could not locate AnyBody in registry
abcutils.AnyPyProcess.start_macro shoud return more informaiton when the model fails. If the failure happens right after a macro command, then also add the macro command to the error message.
Hi! Not a blocker or essential for the JOSS submission, but since this package is intended for reproducible science and you already have a set of Jupyter notebooks as a tutorial I think it would be awesome to use binder for this.
It would help folks to follow the tutorial using an interactive environment.
If you would like to discuss or need some help feel free to ping me
The way the IPython consoles identifies itself seems to have changed. Thus, AnyPyTools tries to use the javascript widget to draw the progress bar, even if it should only be used for the notebook and qt-console.
We should make a better error/warning when using search_subdirs
which doesn't match any files.
e.g.
app.start_marcro(..., search_subdirs="no_such_file.any")
Right now this fails silently
Thanks, @pgalibarov for pointing this out.
Patch to fix the interpolation function when writing the interpolated database.
When rewriting the interpolated time-dependent columns, it was trying to access the column which was used as interpolating value, although it had been dropped from the dataframe indexes.
Enrico & Marc
get_anybodycon_path() only checks if the path is set in the registry, but not whether the given path actually exists. This results in errors without an error message if the path is empty. It would be nice to check if the path points to an existing file and throw an exception if it doesn't.
The relevant method is here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.