GithubHelp home page GithubHelp logo

anybody-research-group / anypytools Goto Github PK

View Code? Open in Web Editor NEW
18.0 15.0 9.0 8.14 MB

Python tools and utilities for working with the AnyBody Modelling System

Home Page: https://anybody-research-group.github.io/anypytools

License: MIT License

Python 100.00%
python anybody

anypytools's People

Contributors

abrg-data-access avatar arfon avatar bkje14 avatar depierie avatar gitter-badger avatar johnrasmussenanybody avatar kasperprasmussen avatar mateisarivan avatar melund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anypytools's Issues

Detect if AnyBody win registry setting is missing

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

AnyPyTools - KeyError

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

Report more usefull message on returncode 234

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

SetValue does not work as expected

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.

More instances than number licences make AMS stop

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.

Could not locate AnyBody in registry

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.

Version info:

  • conda version : 4.10.3
  • conda-build version : 3.21.6
  • python version : 3.8.12.final.0
  • anypytools: version = 1.7.5 build=py38haa244fe_1 channel=conda-forge
  • Windows 10 Version = 10.0.18363 Build = 18363

code

(from http://localhost:8888/notebooks/01_Getting_started_with_anypytools.ipynb)

from anypytools import AnyPyProcess 
    app = AnyPyProcess()

Error message:

 OSError: Could not locate AnyBody in registry

Trace:

---------------------------------------------------------------------------
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

Add more information when models return an error

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.

Suggestion: Add binder example

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

Fix interpolation in dataframe creation

fix_interpolation.zip

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() doesn't check if file exists

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.