Skip to content

Commit

Permalink
Merge pull request #81 from sepandhaghighi/dev
Browse files Browse the repository at this point in the history
Version 1.0
  • Loading branch information
sepandhaghighi authored Jan 11, 2021
2 parents 3590685 + e7939d1 commit f67495b
Show file tree
Hide file tree
Showing 16 changed files with 428 additions and 286 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://www.pyrgg.ir/donate.html
2 changes: 1 addition & 1 deletion .travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if [ "$IS_IN_TRAVIS" = 'false' ] || [ "$TRAVIS_PYTHON_VERSION" = '3.6' ]
then
$PYTHON_COMMAND -m vulture pyrgg setup.py otherfile --min-confidence 65 --sort-by-size
$PYTHON_COMMAND -m bandit -r pyrgg -s B311,B403,B322
$PYTHON_COMMAND -m bandit -r pyrgg -s B311,B403
$PYTHON_COMMAND otherfile/version_check.py
$PYTHON_COMMAND -m pydocstyle --match-dir=pyrgg -v
fi
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# Other Contributors #
----------
- [ivanovmg](https://github.com/ivanovmg)

- Ahmad Salimi - Sharif University of Technology ([@ahmadsalimi](https://github.com/ahmadsalimi)) ([[email protected]](mailto:[email protected]))
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.0] - 2021-01-11
### Added
- Number of files option
### Changed
- All flags type changed to `bool`
- Menu optimized
- The `logger` function enhanced.
- Time format in the `logger` changed to `%Y-%m-%d %H:%M:%S`
- `dl_maker` function modified
- `tgf_maker` function modified
- `gdf_maker` function modified
- `run` function modified
## [0.9] - 2020-10-07
### Added
- GEXF format
Expand Down Expand Up @@ -101,7 +113,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- JSON format
- README

[Unreleased]: https://github.com/sepandhaghighi/pyrgg/compare/v0.9...dev
[Unreleased]: https://github.com/sepandhaghighi/pyrgg/compare/v1.0...dev
[1.0]: https://github.com/sepandhaghighi/pyrgg/compare/v0.9...v1.0
[0.9]: https://github.com/sepandhaghighi/pyrgg/compare/v0.8...v0.9
[0.8]: https://github.com/sepandhaghighi/pyrgg/compare/v0.7...v0.8
[0.7]: https://github.com/sepandhaghighi/pyrgg/compare/v0.6...v0.7
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,32 @@ Pyrgg target audiences are computer scientists who study graph algorithms and gr
<tr>
<td align="center">Code Quality</td>
<td align="center"><a href="https://www.codacy.com/app/sepand-haghighi/pyrgg?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=sepandhaghighi/pyrgg&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/11ec048bcd594d84997380b64d2d4add"/></a></td>
<td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/pyrgg"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/pyrgg/badge" alt="CodeFactor" /></a></td>
<td align="center"><a href="https://codebeat.co/projects/github-com-sepandhaghighi-pyrgg-dev"><img alt="codebeat badge" src="https://codebeat.co/badges/3f6c7449-3dfc-406b-b233-9fe615c2d103" /></a></td>
<td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/pyrgg"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/pyrgg/badge" alt="CodeFactor" /></a></td>
</tr>
</table>


## Installation

### Source Code
- Download [Version 0.9](https://github.com/sepandhaghighi/pyrgg/archive/v0.9.zip) or [Latest Source ](https://github.com/sepandhaghighi/pyrgg/archive/dev.zip)
- Download [Version 1.0](https://github.com/sepandhaghighi/pyrgg/archive/v1.0.zip) or [Latest Source ](https://github.com/sepandhaghighi/pyrgg/archive/dev.zip)
- `pip install -r requirements.txt` or `pip3 install -r requirements.txt` (Need root access)
- `python3 setup.py install` or `python setup.py install` (Need root access)

### PyPI

- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- `pip install pyrgg==0.9` or `pip3 install pyrgg==0.9` (Need root access)
- `pip install pyrgg==1.0` or `pip3 install pyrgg==1.0` (Need root access)

### Conda

- Check [Conda Managing Package](https://conda.io)
- `conda install -c sepandhaghighi pyrgg` (Need root access)

### Exe Version (Only Windows)
- Download [Exe-Version 0.9](https://github.com/sepandhaghighi/pyrgg/releases/download/v0.9/PYRGG-0.9.exe)
- Run `PYRGG-0.9.exe`
- Download [Exe-Version 1.0](https://github.com/sepandhaghighi/pyrgg/releases/download/v1.0/PYRGG-1.0.exe)
- Run `PYRGG-1.0.exe`

### System Requirements
Pyrgg will likely run on a modern dual core PC. Typical configuration is:
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
art==4.8
art==5.1
pyyaml==5.3.1
codecov>=2.0.15
scipy>=1.2.0
Expand Down
10 changes: 5 additions & 5 deletions otherfile/Version.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(0, 9, 0, 0),
prodvers=(0, 9, 0, 0),
filevers=(1, 0, 0, 0),
prodvers=(1, 0, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x40004,
Expand All @@ -16,12 +16,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'Sepand Haghighi'),
StringStruct(u'FileDescription', u'PYRGG.exe'),
StringStruct(u'FileVersion', u'0.9.0.0'),
StringStruct(u'FileVersion', u'1.0.0.0'),
StringStruct(u'InternalName', u'PYRGG.exe'),
StringStruct(u'LegalCopyright', u'Copyright (c) 2020 Sepand Haghighi'),
StringStruct(u'LegalCopyright', u'Copyright (c) 2021 Sepand Haghighi'),
StringStruct(u'OriginalFilename', u'PYRGG.exe'),
StringStruct(u'ProductName', u'PYRGG'),
StringStruct(u'ProductVersion', u'0, 9, 0, 0')])
StringStruct(u'ProductVersion', u'1, 0, 0, 0')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down
2 changes: 1 addition & 1 deletion otherfile/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import codecs
Failed = 0
VERSION = "0.9"
VERSION = "1.0"

VERSION_1 = VERSION.split(".")[0]
VERSION_2 = str(int(float(VERSION) * 10 - int(VERSION_1) * 10))
Expand Down
50 changes: 40 additions & 10 deletions pyrgg/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
15: gexf_maker}


def run():
def gen_graph(input_dict, file_name):
"""
Run proper converter.
Generate a single graph.
:param input_dict: input data
:type input_dict: dict
:param file_name: file name
:type file_name: str
:return: None
"""
input_dict = get_input()
first_time = time.perf_counter()
file_name = input_dict["file_name"]
weight = input_dict["weight"]
min_weight = input_dict["min_weight"]
max_weight = input_dict["max_weight"]
vertices_number = input_dict["vertices"]
Expand All @@ -44,8 +47,8 @@ def run():
direct = input_dict["direct"]
self_loop = input_dict["self_loop"]
multigraph = input_dict["multigraph"]
print("Generating . . . ")
edge_number = GENERATOR_MENU[input_dict["output_format"]](
output_format = input_dict["output_format"]
edge_number = GENERATOR_MENU[output_format](
file_name,
min_weight,
max_weight,
Expand All @@ -56,24 +59,51 @@ def run():
direct,
self_loop,
multigraph)
if input_dict["output_format"] == 4:
if output_format == 4:
json_to_yaml(file_name)
if input_dict["output_format"] == 7:
if output_format == 7:
json_to_pickle(file_name)
filesize(file_name + SUFFIX_MENU[input_dict["output_format"]])
filesize(file_name + SUFFIX_MENU[output_format])
second_time = time.perf_counter()
elapsed_time = second_time - first_time
elapsed_time_format = time_convert(str(elapsed_time))
print("Total Number of Edges : " + str(edge_number))
print("Graph Generated in " + elapsed_time_format)
print("Where --> " + SOURCE_DIR)
logger(
file_name + SUFFIX_MENU[output_format],
vertices_number,
edge_number,
file_name + ".gr",
max_edge,
min_edge,
direct,
sign,
multigraph,
self_loop,
weight,
max_weight,
min_weight,
elapsed_time_format)


def run():
"""
Run proper converter.
:return: None
"""
input_dict = get_input()
file_name = input_dict["file_name"]
number_of_files = input_dict["number_of_files"]
for i in range(number_of_files):
print("Generating {0} from {1}".format(i + 1, number_of_files))
file_name_temp = file_name
if number_of_files > 1:
file_name_temp = file_name + "_" + str(i + 1)
gen_graph(input_dict, file_name_temp)
line(40)


if __name__ == "__main__":
tprint("Pyrgg", "larry3d")
tprint("v" + PYRGG_VERSION)
Expand Down
Loading

0 comments on commit f67495b

Please sign in to comment.