Skip to content

Add timestamp argument to STEP export #984

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

jgraichen
Copy link

Allow passing a timestamp value when exporting STEP files, to generate STEP files with a specific timestamp value in the file header.

For example, a null timestamp (0000-00-00T00:00:00), or a static timestamp can be used when generated files should be equal if there are no visual changes, such as for file versioning.

This commit extends the #export_step function, to accept a timestamp keyword argument, that can be a string or a datetime object. Accepting a datetime object makes it easier to use from Python, like a source file modification date.


In jgraichen/someline I store the exported step files in the Git repository, but the current timestamp in the file always results in changes. I use them there in a CI pipeline to ensure that the code always generates the same models as before.

Currently, I have to strip the timestamp after the export. Passing a timestamp directly when exporting would make it much easier and directly allow reproducible builds.

Some formatting changes are from black, some imports were not used anymore.

Copy link
Owner

@gumyr gumyr left a comment

Choose a reason for hiding this comment

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

Thanks, this looks like a good feature. It can be irritating when things like timestamps make files artificially different.

Allow passing a timestamp value when export STEP files, to generate STEP
files with a specific timestamp value in the file header.

For example, a null timestamp (`0000-00-00T00:00:00`), or a static
timestamp can be used when generated files should be equal if there are
no visual changes, such as for file versioning.

This commit extends the `#export_step` function, to accept a `timestamp`
keyword argument, that can be a string or a `datetime` object. A
`datetime` is easier to use from Python.
@jgraichen jgraichen force-pushed the f/export-step-timestamp branch from 90c05ee to 2f5bb9c Compare May 7, 2025 16:38
@jgraichen jgraichen requested a review from gumyr May 7, 2025 16:39
Copy link

codecov bot commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.93%. Comparing base (7c52e50) to head (2f5bb9c).
Report is 11 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #984      +/-   ##
==========================================
- Coverage   96.94%   96.93%   -0.01%     
==========================================
  Files          32       32              
  Lines        9883     9887       +4     
==========================================
+ Hits         9581     9584       +3     
- Misses        302      303       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants