FieldOutputRequestState in Abaqus Scripting, can anyone get it to work? - python

I am try to extract the status (e.g. 'CREATED' or 'MODIFIED') from a specific step of a CAE model using Abaqus scripting using the line below:
value = mdb.models['my_model_name'].steps['Step-1'].fieldOutputRequestState['F-Output-1'].status
However I am getting the following error:
exceptions.AttributeError: 'StaticStep' object has no attribute 'fieldOutputRequestState'
What am I doing wrong?? I am able to confirm that 'F-Output-1' is the correct name from using the following line which does work:
field_outputs = mdb.models['my_model_name'].fieldOutputRequests.keys()
Also using the field output requests manager in the GUI shows as expected so it is definitely a scripting issue. Any help appreciated!

Related

PyWinAuto with out using "child_window"

I have NO return on child_window when the program is in its state i expect to work in.
I need a way to edit the text field but literally all examples and google searches i have done show no examples of implementation EXCEPT when using child_window
this should put Test into the edit field
from pywinauto.application import Application
app = Application(backend="uia").connect(title="DaVinci Resolve Studio - Template")
#app.DaVinciResolveStudioTemplate.print_control_identifiers()
Title = app.DaVinciResolveStudioTemplate.['TitleEdit', 'Edit8'].wrapper_object()
Title.type_keys("Test")
it returns a syntax error
I have read teh documentation and i HONESTLY have no idea how to initiate the return with out a child window. Googing "no child_window" with multiple iterations has yielded me hours wasted and NOT ONE solution.
if text is entered the child_window appears in returns, but that isnt how the program start's
This is the native return
please, explain it for me how im supposed to seach/grab/interact with out child window? with a example please because this has me at a loss
Syntax error is in line Title = app.DaVinciResolveStudioTemplate.['TitleEdit', 'Edit8'].wrapper_object().
This line should be written as either Title = app.DaVinciResolveStudioTemplate['TitleEdit', 'Edit8'].wrapper_object() or Title = app.DaVinciResolveStudioTemplate.Edit8.wrapper_object().

AttributeError: 'ResourceSummaryWriter' object has no attribute 'get_logdir'

I am trying to run some code written in tensorflow v1.0 in tensorflow 2.1 library package. So I have to rewrite some of the code. I have been facing some problem with one line of the codes
LOG_DIR='./'
summary_writer = tf.summary.FileWriter(LOG_DIR)
now I understand that in v2.0, tf.summary has been deprecated and I was to write the new code instead
summary_writer = tf.summary.create_file_writer(LOG_DIR)
but whenever i start to run
logdir = summary_writer.get_logdir()
It gives me an error of
AttributeError: 'ResourceSummaryWriter' object has no attribute 'get_logdir'
I search around and found no solution. What can be the problem? Isn't it just stating the LOG_DIR (which I have done)
Regards
I got the same error, after a long struggling with that, I just solved it.
I just modified the core source "~tensorboard/plugins/projector/init.py"
I got rid of lines 'logdir' and pass the log file path to "summary_writer"
------------------ "~tensorboard/plugins/projector/init.py----------------------
enter image description here
------------------ myapp.py--------------------------------
enter image description here

Gensim Attribute Error when trying to use pre_scan on a doc2vec object

I am following the tutorial here:
https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/doc2vec-wikipedia.ipynb
But when I get to this part:
pre = Doc2Vec(min_count=0)
pre.scan_vocab(documents)
I get the following error on scan_vocab:
AttributeError: 'Doc2Vec' object has no attribute 'scan_vocab'
Does anyone know how to fix this? Thanks.
That's a known problem after a 2018 refactoring of the Doc2Vec code:
https://github.com/RaRe-Technologies/gensim/issues/2085
You can just skip that cell to proceed with the rest of that demo notebook. (If you really needed to adjust the min_count using the info from a full-scan, you might be able to call some internal classes/methods mentioned in the above issue.)

Azure ML Studio: How to change input value with Python before it goes through data process

I am currently attempting to change the value of input as it goes through data process in Azure ML. However, I cannot find a clue about how to access to the input data with python.
For example, if you were to use python, you can access to the column of data with
print(dataframe1["Hello World"])
I tried to change the name of Web Service Input and tried to do it like how I did for other dataframe (e.g. sample)
print(dataframe["sample"])
But it returns an error with no luck, and from what I read from an error, it's not compatible to dataframe:
object of type 'NoneType' has no len()
I tried to look up a solution with Nonetype error, but there is no good solution.
The whole error message:
requestId = 1f0f621f1d8841baa7862d5c05154942 errorComponent=Module. taskStatusCode=400. {"Exception":{"ErrorId":"FailedToEvaluateScript","ErrorCode":"0085","ExceptionType":"ModuleException","Message":"Error 0085: The following error occurred during script evaluation, please view the output log for more information:\r\n---------- Start of error message from Python interpreter ----------\r\nCaught exception while executing function: Traceback (most recent call last):\r\n File \"C:\\server\\invokepy.py\", line 211, in batch\r\n xdrutils.XDRUtils.DataFrameToRFile(outlist[i], outfiles[i], True)\r\n File \"C:\\server\\XDRReader\\xdrutils.py\", line 51, in DataFrameToRFile\r\n attributes = XDRBridge.DataFrameToRObject(dataframe)\r\n File \"C:\\server\\XDRReader\\xdrbridge.py\", line 40, in DataFrameToRObject\r\n if (len(dataframe) == 1 and type(dataframe[0]) is pd.DataFrame):\r\nTypeError: object of type 'NoneType' has no len()\r\nProcess returned with non-zero exit code 1\r\n\r\n---------- End of error message from Python interpreter ----------"}}Error: Error 0085: The following error occurred during script evaluation, please view the output log for more information:---------- Start of error message from Python interpreter ----------Caught exception while executing function: Traceback (most recent call last): File "C:\server\invokepy.py", line 211, in batch xdrutils.XDRUtils.DataFrameToRFile(outlist[i], outfiles[i], True) File "C:\server\XDRReader\xdrutils.py", line 51, in DataFrameToRFile attributes = XDRBridge.DataFrameToRObject(dataframe) File "C:\server\XDRReader\xdrbridge.py", line 40, in DataFrameToRObject if (len(dataframe) == 1 and type(dataframe[0]) is pd.DataFrame):TypeError: object of type 'NoneType' has no len()Process returned with non-zero exit code 1---------- End of error message from Python interpreter ---------- Process exited with error code -2
I have also tried to a way to pass python script in data, but it is not able to make any change to Web Service Input value as I want it to be.
I have tried to look on forums like msdn or SO, but it's been difficult to find any information about it. Please let me know if you need any more information if needed. I would greatly appreciate your help!
tl;dr; You need to also link the dataset you used for training to the same port you link the Web service input, so that the Execute Python Script has something to work on - see the image below for how this should look.
You need to keep in mind that the Predictive experiment has some conventions that need to be followed (or learned the hard way :) ). One of them is that in order to use the Web service input, you need to pair it with an actual dataset, which Azure ML Studio can then use to infer structure and to provide you with some data while testing your predictive experiment. You can see it as some sort of 'ghost' module that doesn't do anything by itself.
Hope this helps.

Check Domain Availability using Boto Route53

I love using Boto API for Amazon Web Services but now I'm not capable of finding where is the error.
I'm using AWS for check domain availability and I have created a script in Python that includes the class at this link:
https://www.codatlas.com/github.com/boto/boto/develop/boto/route53/domains/layer1.py?line=67
I call the method check_domain_availability() on passing domain name:
Route53DomainsConnection.check_domain_availability('example.com',None)
but the method returns this error:
AttributeError: 'str' object has no attribute 'make_request'
I can try to pass parameters in many modes but no result.
Where am I wrong? Thanks in advance.
P.S: I use Debian wheezy and Python3.2
More on status of subdomains
I have found a method to get the status of a record just create with route53.
this is the code:
changes = ResourceRecordSets(conn, "ZONEID")
change = changes.add_change("STRING FOR ADD NEW SUBDOMAIN")
change.add_value(MY_IP)
status = changes.commit()
If print the status variable is contained the response of commit and the status:
{u'ChangeResourceRecordSetsResponse':{u'ChangeInfo': {u'Status: u'PENDING etc.....
Now i would like to be able to swhitch to another operation only if the status of subdomamin is "SYNC" but i doesn't able to access dinamically to string for check status.
I can use a while ? Can i use sleep command ? Can anyone help me over to resolve my problem ? Thanks
You don't show your code which makes it harder to debug but this line:
Route53DomainsConnection.check_domain_availability('example.com',None)
looks suspicious. It looks like you are trying to access the check_domain_availability method from the class rather than an instance of the class. I just did the following and it worked for me:
In [1]: import boto.route53.domains
In [2]: c = boto.route53.domains.connect_to_region('us-east-1')
In [3]: c.check_domain_availability('foobar.com')
Out[3]: {u'Availability': u'UNAVAILABLE'}

Categories

Resources