aider/aider
Paul Gauthier 3045c5e94d aider: Removed unused imports and changed comparison to None to use is instead of == in aider/history.py, aider/models/__init__.py, and aider/models/openrouter.py.
# Aider chat conversation:

USER: I ran this command:

 pre-commit run --all-files

And got this output:

isort....................................................................Passed
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

aider/history.py:4:1: F401 'tiktoken' imported but unused
import tiktoken
^
aider/models/__init__.py:2:1: F401 '.openai.OpenAIModel' imported but unused
from .openai import OpenAIModel
^
aider/models/__init__.py:3:1: F401 '.openrouter.OpenRouterModel' imported but unused
from .openrouter import OpenRouterModel
^
aider/models/openrouter.py:26:33: E711 comparison to None should be 'if cond is None:'
        if cached_model_details == None:
                                ^

ASSISTANT: It seems like there are some unused imports and a comparison to None that is not following the Pythonic way. To fix these issues, we need to modify the following files:

1. `aider/history.py`
2. `aider/models/__init__.py`
3. `aider/models/openrouter.py`

Please add these files to the chat so I can propose the necessary changes.

USER: I added these *read-write* files: aider/history.py, aider/models/openrouter.py, aider/models/__init__.py

ASSISTANT: Great! Now, let's make the necessary changes to these files.

First, in `aider/history.py`, we need to remove the unused import `tiktoken`.

```python
aider/history.py
<<<<<<< HEAD
import tiktoken
=======
>>>>>>> updated
```

Next, in `aider/models/__init__.py`, we need to remove the unused imports `OpenAIModel` and `OpenRouterModel`.

```python
aider/models/__init__.py
<<<<<<< HEAD
from .openai import OpenAIModel
from .openrouter import OpenRouterModel
=======
>>>>>>> updated
```

Finally, in `aider/models/openrouter.py`, we need to change the comparison to None to use `is` instead of `==`.

```python
aider/models/openrouter.py
<<<<<<< HEAD
        if cached_model_details == None:
=======
        if cached_model_details is None:
>>>>>>> updated
```

These changes should resolve the issues reported by the `flake8` linter.
2023-09-01 15:54:22 -07:00
..
coders lint 2023-09-01 15:53:19 -07:00
models aider: Removed unused imports and changed comparison to None to use is instead of == in aider/history.py, aider/models/__init__.py, and aider/models/openrouter.py. 2023-09-01 15:54:22 -07:00
__init__.py set version to 0.13.1-dev 2023-08-22 08:04:24 -07:00
commands.py initial code for working with openrouter 2023-08-23 14:39:12 +12:00
diffs.py use utf-8 2023-07-05 20:51:35 -07:00
dump.py isort 2023-05-28 22:47:38 -07:00
history.py aider: Removed unused imports and changed comparison to None to use is instead of == in aider/history.py, aider/models/__init__.py, and aider/models/openrouter.py. 2023-09-01 15:54:22 -07:00
io.py pass the input history as a prompt to whisper 2023-08-11 11:03:37 -03:00
main.py finishing openrouter integration 2023-08-23 21:26:27 +12:00
prompts.py Add summary prefix 2023-07-22 12:11:01 -03:00
repo.py initial code for working with openrouter 2023-08-23 14:39:12 +12:00
repomap.py finishing openrouter integration 2023-08-23 21:26:27 +12:00
sendchat.py lint 2023-09-01 15:53:19 -07:00
utils.py Adopt safe_abs_path 2023-07-07 17:17:33 -07:00
versioncheck.py cleanup 2023-07-20 09:49:40 -03:00
voice.py Late-bind importing sounddevice, as it was slowing down aider startup 2023-08-19 15:18:46 -07:00