Skip to content

Commit

Permalink
doc(compute): Update readme to use compute_ecoindex() method (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot authored May 14, 2024
1 parent 7a1ec17 commit efacca5
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 133 deletions.
8 changes: 6 additions & 2 deletions development/ecoindex_compute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from ecoindex.models import Ecoindex
import asyncio
from pprint import pprint

print(Ecoindex(grade="A", score=99.9, ges=0.6, water=0.1))
from ecoindex.compute import compute_ecoindex

ecoindex = asyncio.run(compute_ecoindex(nodes=100, size=100, requests=100))
pprint(ecoindex)
10 changes: 5 additions & 5 deletions projects/ecoindex_compute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ pip install ecoindex_compute

## Use

### Get ecoindex
### Compute ecoindex

You can easily get the ecoindex by calling the function `get_ecoindex()`:
You can easily compute the ecoindex by calling the function `compute_ecoindex()`:

```python
(function) get_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex]
(function) compute_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex]
```

Example:
Expand All @@ -36,10 +36,10 @@ Example:
import asyncio
from pprint import pprint

from ecoindex.compute import get_ecoindex
from ecoindex.compute import compute_ecoindex

# Get ecoindex from DOM elements, size of page and requests of the page
ecoindex = asyncio.run(get_ecoindex(dom=100, size=100, requests=100))
ecoindex = asyncio.run(compute_ecoindex(nodes=100, size=100, requests=100))
pprint(ecoindex)
```

Expand Down
Loading

1 comment on commit efacca5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage PR

Branch coverage •
FileStmtsMissCoverMissing
TOTAL69523066% 
report-only-changed-files is enabled. No files were changed during this commit :)

Please sign in to comment.