Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CopyLogs does not work in python with MergeStrategy WipeExisting #11039

Closed
KarlPalmen opened this issue Sep 1, 2014 · 1 comment
Closed

CopyLogs does not work in python with MergeStrategy WipeExisting #11039

KarlPalmen opened this issue Sep 1, 2014 · 1 comment
Assignees
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Milestone

Comments

@KarlPalmen
Copy link
Contributor

This ticket is blocks : TRAC10052

CopyLogs does not work in the following script. The WipeExisting merge strategy is not recognised.

# Create two workspaces
demo_ws1 = CreateWorkspace(DataX=range(0,3), DataY=(0,2))
demo_ws2 = CreateWorkspace(DataX=range(0,3), DataY=(0,2))

# Add sample logs first workspace
AddSampleLog(Workspace=demo_ws1, LogName='x', LogText='hello world', LogType='String')
AddSampleLog(Workspace=demo_ws1, LogName='y', LogText='1', LogType='Number')
AddSampleLog(Workspace=demo_ws1, LogName='z', LogText='2', LogType='Number Series')

# Add sample logs second workspace
AddSampleLog(Workspace=demo_ws2, LogName='x', LogText='hello universe', LogType='String')
AddSampleLog(Workspace=demo_ws2, LogName='w', LogText='3', LogType='Number')

# Fetch the generated logs
run1 = demo_ws1.getRun()
log_x1 = run1.getLogData('x')
log_y = run1.getLogData('y')
log_z = run1.getLogData('z')
run2 = demo_ws2.getRun()
log_x2 = run2.getLogData('x')
log_w = run2.getLogData('w')

# Print the log values
print "Before CopyLog"
print "1st workspace log values x =",log_x1.value,", y =", log_y.value,", z =", log_z.value
print "2nd workspace log values x =",log_x2.value,", w =", log_w.value

# Copy logs of 1st workspace to 2nd workspace
CopyLogs( demo_ws1, demo_ws2, MergeStrategy='•WipeExisting')

# Fetch the new logs
run1 = demo_ws1.getRun()
log_x1 = run1.getLogData('x')
log_y = run1.getLogData('y')
log_z = run1.getLogData('z')
run2 = demo_ws2.getRun()
log_x2 = run2.getLogData('x')
log_y2 = run2.getLogData('y')
log_z2 = run2.getLogData('z')

# Print the log values
print "After CopyLog"
print "1st workspace log values x =",log_x1.value,", y =", log_y.value,", z =", log_z.value
print "2nd workspace log values x =",log_x2.value,", y =", log_y2.value,", z =", log_z2.value

Similar scripts work with the other two merge strategies and WipeExisting works in the GUI.

This issue prevents the creation of a usage example with WipeExisting.

@KarlPalmen
Copy link
Contributor Author

This issue was originally trac ticket 10197

@KarlPalmen KarlPalmen added High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Framework Issues and pull requests related to components in the Framework labels Jun 3, 2015
@KarlPalmen KarlPalmen added this to the Release 3.3 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Projects
None yet
Development

No branches or pull requests

2 participants