You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very Large Active Code Cells. Active code cell was very large, (it contained a mapping from each country to its continent, generated by the AI), then when he asked it to make a change to the final line of that code cell that actually applies the mapping, instead of returning the entire mapping with the edit, it just returned the new edit.
Empty kernels When the user has only ran import mitosheet and asks the Ai to do some edits to a dataframe. It should not revert to using example dataframes or hallucinate a dataframe called mitosheet
Long chats with specific instructions Its having a really hard time continuing to follow his instructions to use the yahoo finance. Each time he goes to fix a problem in the cell, it reverts to the method that does not use the yfinance. He asked it once to use yfinance in second message and it should know to continue using that. Maybe this is because he has a long chat running and its having a hard time paying attention to the right pieces.
Sending messages like hi or thanks should have reasonable responses
Sending messages like what can you help me with?Do you know about my data etc should have reasonable responses
Don't return prefix Sometimes if you want to print out a variable and called dataframes and you start writing dat it will suggest the full completion dataframes which leaves you with the code datdataframes.
Smart Debugging
Don't remove imports The smart debug sometimes removes imports. My guess is that because it sees that the packages are already imported, it then decides that it does not need to reimport them and removes it from the code.
Invalid dataframe creation -- array have different lengths To fix this, it should figure out which one has the incorrect length and then correct it.
See example dataframe
This dataframe has one extra value in the points_per_game array
Sometimes the returned code is annotated with the changes. For example: slide.shapes.add_picture(chart_path, left, top, width=Inches(8)) # Corrected keyword argument. Here, we don't want the comment "# Corrected keyword argument". That can be in the chat explanation, but not the code.
Removing comments In this example, the AI removed comments from the original code that should not have been removed.
See example dataframe
Starting code
frompptximportPresentationfromopenpyxlimportWorkbookfromopenpyxl.stylesimportFont, PatternFill, Alignment, Border, Sidefromopenpyxl.utilsimportget_column_letterimportpandasaspdimportosdefcreate_formatted_excel(df, excel_path):
""" Creates a professionally formatted Excel file from our banking data. This function applies corporate styling and financial data formatting. Parameters: df: The pandas DataFrame containing our bank analysis data excel_path: Where to save the formatted Excel file """# Create a new workbook and select the active sheetwb=Workbook()
ws=wb.activews.title="Bank Analysis"# Write headersforcol_idx, columninenumerate(df.columns, 1):
cell=ws.cell(row=1, column=col_idx, value=column)
# Apply header stylingcell.font=Font(bold=True, color="FFFFFF", size=12)
cell.fill=PatternFill(start_color="00316A", end_color="00316A",
fill_type="solid") # RBC dark bluecell.alignment=Alignment(horizontal="center", vertical="center")
# Write data and apply formattingforrow_idx, rowinenumerate(df.values, 2):
forcol_idx, valueinenumerate(row, 1):
cell=ws.cell(row=row_idx, column=col_idx, value=value)
# Apply specific formatting based on column typeifdf.columns[col_idx-1] =="Market Share":
cell.number_format="0.0%"elifdf.columns[col_idx-1] =="Total Assets":
cell.number_format='"$"#,##0"B"'cell.alignment=Alignment(horizontal="center", vertical="center")
cell.font=Font(size=11)
# Apply borders to all cellsborder=Border(left=Side(style='thin'), right=Side(style='thin'),
top=Side(style='thin'), bottom=Side(style='thin'))
forrowinws.iter_rows(min_row=1, max_row=len(df)+1,
min_col=1, max_col=len(df.columns)):
forcellinrow:
cell.border=border# Adjust column widths for readabilityforcolumninws.columns:
max_length=0column_letter=get_column_letter(column[0].column)
forcellincolumn:
try:
max_length=max(max_length, len(str(cell.value)))
except:
pass# Add some padding to the widthadjusted_width= (max_length+2)
ws.column_dimensions[column_letter].width=adjusted_width# Save the formatted Excel filewb.save(excel_path)
defcreate_linked_powerpoint(excel_path, pptx_path):
""" Creates a PowerPoint presentation with a linked Excel table. The table will automatically update when the Excel file changes. Parameters: excel_path: Path to the formatted Excel file pptx_path: Where to save the PowerPoint file """prs=Presentation()
slide=prs.slides.add_slide(prs.slide_layouts[1])
# Add titletitle=slide.shapes.titletitle.text="Bank Analysis Summary"# Get the content placeholderplaceholder=slide.placeholders[1]
# Create a link to the Excel file# We need absolute paths for the linking to work correctlyabs_excel_path=os.path.abspath(excel_path)
# Insert the Excel worksheet as a linked objectplaceholder.insert_ole_object(
prog_id="Excel.Sheet",
file=abs_excel_path,
icon=False, # Show the actual table, not an iconlink=True# Create a link rather than embedding
)
# Now let's put it all togetherdefcreate_bank_analysis_presentation():
""" Creates both the Excel file and PowerPoint presentation with proper linking. This is our main function that coordinates the entire process. """# Prepare our databanks=pd.DataFrame({
'stock': ['RY', 'JPM', 'BNPQY', 'TD', 'GS', 'C'],
'name': ['Royal Bank of Canada', 'JPMorgan Chase & Co.', 'BNP Paribas',
'Toronto-Dominion Bank', 'Goldman Sachs', 'Citigroup'],
'total_assets_B': [1800, 3200, 2900, 1500, 1100, 2300]
})
# Calculate market sharebanks['market_share'] =banks['total_assets_B'] /banks['total_assets_B'].sum()
# Prepare presentation datapresentation_df=banks[['name', 'stock', 'total_assets_B', 'market_share']]
presentation_df.columns= ['Bank Name', 'Ticker', 'Total Assets', 'Market Share']
# Define our file pathsexcel_path='bank_analysis.xlsx'pptx_path='bank_analysis.pptx'# Create the formatted Excel filecreate_formatted_excel(presentation_df, excel_path)
# Create the PowerPoint with the linked tablecreate_linked_powerpoint(excel_path, pptx_path)
# Run our presentation creationcreate_bank_analysis_presentation()
This error `AttributeError: 'SlidePlaceholder' object has no attribute 'insert_ole_object'`
When it returned the code, it removed all of the comments from the original code snippet.
</details>
Eval Infrastructure Improvements
Move the evals to execing code in an ipython kernel
Always have the import mitosheet code executed first
The text was updated successfully, but these errors were encountered:
I asked Mito AI to tell me how to do simple machine learning. The first section of the response was
"Choose a Machine Learning Library: Popular libraries include scikit-learn, TensorFlow, and PyTorch. For beginners, scikit-learn is often recommended due to its simplicity and ease of use."
When I did another prompt that said "import the libraries from section 1", it imported none of these libraries and instead imported mitosheet and pandas.
It would be great if the AI could better recognize prompts that are referring to previous responses in the chat.
Mito AI Chat
import mitosheet
and asks the Ai to do some edits to a dataframe. It should not revert to using example dataframes or hallucinate a dataframe calledmitosheet
hi
orthanks
should have reasonable responseswhat can you help me with?
Do you know about my data
etc should have reasonable responsesIn Line Code Completer
Don't return the prefix
See example
Repeated the entire last line of the prefix
Repeated the last character of the prefix
Calling user defined function
See example
Adding new line characters when required
See example
Same NBA code as above.
Completing docstrings
See example
Same NBA code as above.
Don't return prefix Sometimes if you want to print out a variable and called
dataframes
and you start writingdat
it will suggest the full completiondataframes
which leaves you with the codedatdataframes
.Smart Debugging
Don't remove imports The smart debug sometimes removes imports. My guess is that because it sees that the packages are already imported, it then decides that it does not need to reimport them and removes it from the code.
Invalid dataframe creation -- array have different lengths To fix this, it should figure out which one has the incorrect length and then correct it.
See example dataframe
This dataframe has one extra value in the points_per_game array
Sometimes the returned code is annotated with the changes. For example:
slide.shapes.add_picture(chart_path, left, top, width=Inches(8)) # Corrected keyword argument
. Here, we don't want the comment "# Corrected keyword argument". That can be in the chat explanation, but not the code.Removing comments In this example, the AI removed comments from the original code that should not have been removed.
See example dataframe
Eval Infrastructure Improvements
import mitosheet
code executed firstThe text was updated successfully, but these errors were encountered: